6K Software - How to Use the COM6SRVR with LabVeiw
Right click on your LabView diagram to open the Functions palette.
Go to the Communications/ActiveX meny and drag an instance of the Automation Open VI onto the diagram.
Press the space bar until you have the spool tool, and go to the Automation Refnum terminal in the upper left of the VI.
Right click on this terminal and choose Select ActiveX Class/Browse...
Select Browse and locate the file com6srvr.tlb. [Installing Motion Planner places this file in C:\\WINDOWS\SYSTEM.]
You will now have some options listed:
NET | Connect to a 6K via Ethernet. |
---|---|
RS232 | Connect to a 6K or Gem6K serially. |
GEM6K | Connect to a Gem6K via Ethernet. |
GEMINI | Connect to a GV/GV6 or GT/GT6. Includes an embedded binary translator. |
Â
Â
An ActiveX Automation Refnum constant will now be wired to the terminal.
Now drag an instance of the Invoke Node VI onto the diagram. Wire the Automation Refnum output of the Automation Open VI (upper right) to the Reference input of the Invoke Node VI. This Refnum is a LabView reference to a particular communications session anf should be wiresd from output to input of every VI.
Once the reference is connected, you will see "Automation" change to the name of the connection option that you chose in step 6. Right-click on the method terminal and go to Methods for a list of ComServer methods available for your interface. Choose Connect.
An additional terminal called "commPort" or "net address" will appear, depending on the type of connection you will be using. Wire the appropriate communications address to this terminal.
10. Drag additional instances of the Invoke Node VI onto your diagram as needed. LabView will automatically show you the available methods when you right-click. For Ethernet properties, use the Property Node VI as well. Remember to connect the reference output terminal of the previous VI to the reference input terminal of the next VI. For help on methods and properties, refer to the ComServer User Guide .
11. Drag an instance of the Automation Close VI onto the diagram and connect the terminals. This will shut down the ComServer.