Making a momentary pushbutton
If you need a tag to represent a momentary push button, you can configure an algorithm to return the tag to the off state after a few seconds. That way you only have to change the tag to the on state, and it will go off by itself a few seconds later. To do this, configure the tag with the PulseOn algorithm and use the tag itself as the first parameter. The second parameter is the number of seconds that the tag is to remain on. This is one of the few places in VP Link where a time value is not specified in minutes. Whenever the tag goes on (and it is in Auto), then it starts a timer and will turn off after the specified number of seconds.
To save yourself a few more mouse clicks, you can drag a button onto your graphic so that the tag turns on when you click the button, bypassing the normal “Do what with tag? Manual/SetPVE/Cancel” dialog. You find the button by clicking on the little picture of a valve on the “Tag Definition Page” The button is under the “Dynamic” tab. Drag it off the palette with the tag you want it attached to showing in the Tag Definition Page, and you should be all set.
Creating a timer
You can use an ANL tag with an accumulator algorithm as a timer. Use the AccumPVE algorithm, and use the following parameters: “1, 60, TimerIsRunning; 10000, -60, ResetTheTimer”. The two tags, TimerIsRunning and ResetTheTimer can be used to start/stop/reset the timer. The 60’s in the parameters multiply the passage of time from minutes to seconds, so that the units of the timer are seconds. Note that the ResetTheTimer simply enables the term that subtracts a huge amount from the timer’s value. Since VP Link tags are clamped between their EULo and EUHi, the value of the timer never gets less than zero. If neither ResetTheTimer and TimerIsRunning are true, then the tag will stop incrementing. If only the TimerIsRunning tag is true, then the timer tag will increment to accumulate seconds.
To test the timer to see if it is done, use a tag with the HighPVE algorithm. This algorithm will turn a digital tag true when another tag( the timer in this case) gets above a certain value.
Fine tuning VP Link graphics in Toolbook
In author mode, there is a magnifying glass in the Tool palette. If you select it, then click on the graphic, it will zoom into the graphic, centered on the place that you clicked. Do it again and it zooms in more. Keep zooming in and after three times, you will return to the normal size. This way you do not have to hold any special key down to get back to the normal size. Just keep clicking until you get there.
Changing entries in the VPServer.INI file
If you need to change an entry in the VPServer.INI file, the easiest way to get there is to look under the File menu in the VP Link Control Panel. This will bring up the VPServer.INI file in Notepad. Once you have saved the file, you do not need to restart the VP Link server, just Clear the tags, and then restore them. This will cause the VP Link server to rescan the VPServer.INI file.
Clearing and restoring the tags also works if you have just updated your VPLink.key file.
Troubleshooting networking issues
Start a command prompt window in the VPLink3\Tools directory (there is a shortcut on the Start menu for that). Run “perl VP3Netdiag,pl”. This will go through some networking checks to determine if your network settings are set up Ok for VP Link to work. The most common problem is with your DNS settings. If your fully-qualified domain name does not resolve to your PC, then you may not be able to connect to your VP Link server when it is listed in the Name Server.
The VP3NetDiag.pl will print some messages on the screen, and then open a .html file to the spot that shows you how to resolve the problem it has diagnosed.
Create a “watchdog” tag that toggles back and forth
If you need a tag that will toggle back and forth every so often, then use a digital tag with the FlipFlop algorithm. Set the parameters to “1, 1”. This sets the two inputs to the flipflop algorithm true, and the tag will cycle every time it is calculated. If you need to slow down the rate at which it changes, set the cycle time of the that tag to how many seconds should elapse before the tag’s algorithm is calculated again.
Note there are two other FlipFlop algorithms, SRFlipFlop and RSFlipFlop which provide a stable behavior when both inputs are true.
Make time run backwards
This is not really much of a tip, since we don’t think there is any useful purpose to make the simulation time run backwards. But if you want to “trick” your colleague who is doing the control system programming, try setting the Warp Factor to a negative value. This will make the time-based algorithms run backward, so that the more you put into a tank, the faster it loses level.
Actually, the idea of this trick is to show that we like to let VP Link do what it can without restricting it to what we think it should do. After all, maybe someone will come up with an idea that will need time to run backwards. I would hate to think that it was prevented by the developers, just because they were not smart enough to figure out why that would be useful.
Change a bunch of tags at once
Use the Bulk Config button on the Tag Definition Page to modify a number of tags at once. If the tags you want to modify can be described by a two parameter search (Tagname and Type for instance), then you can use the Bulk configurator to make changes to the database on-line. For instance, you might want to set all the tags that start with ZSO so that their algorithm is OpenLim, and their parameters will be the corresponding XV with the proper loop number. This sort of thing can be done in the Bulk Configurator. You can also use it to set the EULo and EUHi values of tags. This is handy for limit switches, which often have “notOpen”, “isOpen” or notClosed, and “isClosed” as their two states. This is another great reason to have some sort of consistent naming convention for your VP Link (and control system) tags.
You should probably have the I/O turned off when you do this, otherwise you will have to wait after every tag is changed for the driver to update the value. Turning the I/O off will make this process go MUCH faster.
Use the regular expression syntax to your advantage
There are often times when you need to search for a subset of tags within the VP Link database. The SearchTags procedure, which does all the heavy lifting for searches, uses a regular expression syntax for the search expression. If you just search for substrings, thinking that there is a wildcard in front and behind of the string you search for, then you are missing out.
Use the square brackets to specify a set of characters that you are trying to match. For example of you want all the level and flow transmitters, (LT and FT tags), then you would specify [FL]T as your search pattern. This means “F or L, and then a T”. To be more precise, you probably want to only match tags that start with that, so pur a “^” in front of the pattern, like “^[FL]T”. To search for things that end with something, put a “$” at the end. So “_RUN$” would find all the tags that end with _RUN. Remember that the dot means “any character, so “^[FL]T….$” would be any that that starts with FT or LT and then has exactly four characters more until the end of the tagname. The plus sign means “one or more”. So ^[FL]T[0-9]+_RUN$ means any tag that starts with FT or LT, has one or more numbers, then ends with _RUN.
Use vp_check to track down problems with your .cfg file
Vp_check.exe in the VPLink3\Tools directory will check your .cfg file for some obvious ( to it!) errors in your VP Link configuration. It will print error messages if you use tags that do not exist in your parameters, or have two tags that write to the same address (this is particularly hard to diagnose otherwise in a big simulation). Also, in a big simulation, you can end up with tags that you really do not need any more. Maybe you put them in there for testing something out and you do not need them any more. These are called “orphan tags” by VP_check. Any tag that is not an output tag (ANLOUT or DIGOUT) and is not used by another tag in the simulation is marked as an orphan tag. These tags are removed from the output of vp_check.exe unless you specify the –noorphan option, in which case the orphan processing code in vp_check is skipped.
Do not copy whole pages when moving graphics from one Toolbook to another.
If you need to move graphics from one Toolbook book to another, you can get both Toolbook files open at the same time by choosing File/Run in the first Toolbook. Then change the extension from .EXE to .TBK (there is a little tiny scroll bar next to the file type—scroll UP), and open your other Toolbook file. Be careful here, you do not want to save your tags after you do this as your tags might be a mixture of the two .tag files. Go to Author mode in both books, and create a new graphic page in the destination book. Go back to the source book, and select all the items on the page, and then do Edit/Copy. You can “Select All” from the Edit menu as well. Once you have all the items selected and copied go to the blank page you already made in the destination book and paste them. DO NOT SELECT THE PAGE, do copy, and then paste the page into the destination book! This will look like it worked, but it will create a new background in the destination book which confuse your page navigation drop-down box and background scripts to no end! The new background will have the same name as the old background but a different ID number.
The other way to do this is to save your source book with a new name, and remove all the graphics except the ones you wish to copy. Get rid of the start page, the Misc Utilities page, the interlock builder page—all the pages that already exist in or you do not want in your destination book. Then use the Upgrade a Book button in your VPSupprt.TBK book. You do this by closing all your tookbook windows, then open the VPSupprt.TBK book in the VPLink3 \TB40 folder. Click the Upgrade a book button. You will be asked for the book to upgrade (pick this new book that has the graphics you wish to copy) and a VP Blank book. At this point, choose your destination book. Normally when a book is upgraded, its graphics are copied into the new VPBlank.TBK book. But in this case we want to copy the graphics into your existing destination book. The upgrade procedure will do the right thing by selecting all the objects on each graphic page, and then pasting the objects into the destination book a page at a time. Just like before, when this process is finished, save your .TBK file, but DO NOT SAVE your .TAG file. Just get out of Toolbook, stop the VPExec, and restart your toolbook from the VP3 Control Panel and make sure you have the right tags loaded.
Use the Tag Template Generator to create objects in VP Link
The Tag Template Generator, TTGEN, in the VPLink3\Tools directory is a great way to set up VP Link objects that you can replicate. For example, if you want a Fan object that needs discrete feedback as well as calculating the amperage used by the fan, you might want to use the TTGEN to generate a set of tags that represent the fan. In this case, you might have a start and stop command, a running feedback tag, and a tag that calculates the fan amps. The Fan amps are a function of the work the fan does, and that can be approximated by the flow through the fan times the pressure developed by the fan. You might have a tag that calculates the flow from the pressure increase required by the fan that follows the fan performance curve. There could be a number of internal tags required for this calculation. You can create all those internal tags with the TTGEN tool. The tool is basically a “Mail Merge” for VP Link and is described in its own help documentation you can find in the VP Tools help file.
Change Value of VP Link Tag
To quickly change a value of a VP Link tag - Press the ‘Ctrl’ key and then click on a Field or a graphic object on a graphic in toolbook. This will toggle a Discrete tag or open a dialog box to enter a value for an Analog tag.
Move objects on a graphic
Move Objects on a graphic in the “Reader” Mode – Press the ‘Ctrl’ and ‘Alt’ keys and then click on the object with the Mouse down. You can then drag the object to wherever you want.
Use the “Bulk Configurator” to configure tiebacks for groups of tags which have a consistent naming convention.
Help on the Algorithm
Click on the question mark to go the help on the Algorithm on the Tag Definitions window
Use wildcards to narrow down your search. For Example “ZSC$” will find all tags which end with ZSC.
Start VP Link Driver
To start a VP Link driver with a saved document – Create a shortcut for the VP Link driver on the desktop with the following target
"C:\Program Files\CapeSoftware\VPLink3\vpdr_dde.exe" dde.vpdr
Dde.vpdr – Saved document