Home
CUB5 Series – User Manual
Contents
1. 35 Set or Get Timer Stop Value CUBST vi Use this VI to get or set the value of the Timer Stop Value TSP on the timer The input value is a 7 digit integer and is interpreted by the device according to the Timer range as set on the device Signs are disregarded all numbers are treated as positive values The range of the 7 digit integer is checked to be between 9999999 and 0 and an error is returned if out of range Note that for mixed unit ranges including seconds or minutes where the maximum value for a unit is 59 this check is not sufficient For example the value 9999999 will be clipped to 9995959 by the device if the timer range on the device is HHHMMSS Use Format Timer Value vi to format the Timer Stop value number according to a specific timer range which should be chosen to correspond to the timer range on the device and check individual unit values The current Timer Stop Value is always returned by this VI Requires input Timer Range which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set according to the actual device setting so that the timer value is interpreted correctly Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs pp device for example MMM SS SS Desired Timer Stop Value 132 Desired Timer Stop Value ferrorintnoeron opus o o VISA Resource OUT Time
2. operation if applicable error out Connector Pane Counter TA Operation Get YISA Resource port HANE VISA Resource OUT Device Address ae ae Current Scale Factor Desired Scale Factor error out error in Set or Get Timer Setpoint ON Value CUBST vi Use this VI to get or set the value of the Timer Setpoint ON Value SPT on the timer The input value is a 7 digit integer and is interpreted by the device according to the Timer range as set on the device Signs are disregarded all numbers are treated as positive values The range of the 7 digit integer is checked to be between 9999999 and 0 and an error is returned if out of range Note that for mixed unit ranges including seconds or minutes where the maximum value for a unit is 59 this check is not sufficient For example the value 9999999 will be clipped to 9995959 by the device if the timer range on the device is HHHMMSS Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 24 Use Format Timer Value vi to format the Timer Setpoint ON Value number according to a specific timer range which should be chosen to correspond to the timer range on the device and check individual unit values The current Timer Setpoint ON Value is always returned by this VI Requires input Timer Range which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set according to the ac
3. READ READ CUBS CUBS KN KA READ READ CUBS CUBS fount mu WRITE WRITE CUBS TIHER RITE Figure 10 Simple Example block diagram Changing Configuration Values If you want to add the ability to change a configuration value on the Device this can be done by inserting a subVI and using the Set Get property For example the block diagram of a simple VI to change the Cycle Count Start Value for a CUB5T Timer would look similar to Figure 11Figure 11 where the Set or Get Cycle Count Start Value CUB5 vi is used The default value of the Set Get property is to Get read the current configuration value If it is desired to change the value then the desired values must be wired to the appropriate input of the subVI and the Set Get property must be changed to Set write Note that the subVI will always Get read the value of the property after setting it and return the current configuration value Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com s415 Untitled Block Diagram File Edit View Project Operate Tools Window Help ole lo hal ammen ME A VISA resource name Port Td jeg FA fen Baud Rate 9600 utan ses oe SET GET CLOSE EE ENE ag aana Confiqure CUBS CUBS CLDA TSF SELGET ET GET CUBS CUBS CT SEAL SELGET ET GET CUBS CUBS FL SETFT i SETGET CUBS CUES STO a SOF g SETGET SET GET CUBS CUBS SFT TST SETGET SET GET Device Addre
4. Value double current value of count load value after Set OR if applicable error errorout Connector Pane Operation Get YISA Resource port CUES Device Address ae Desired Count Load value i error in Scaling 1 0 VISA Resource QUT Count Load value Set or Get Setpoint CUB5 vi Use this VI to get or set the value of the setpoint specify Setpoint 1 or Setpoint 2 with input The value of the setpoint must be within the limit of the counter This is NOT checked by this VI The desired setpoint is divided by scaling value default 1 0 to correspond to the counter scaling factor and converted to 116 before being written The current setpoint is always returned by this VI Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts o TT Setpoint enum Set to choose Setpoint 1 or Setpoint 2 Desired Setpoint double Desired Setpoint value Scaling value double Optional input to adjust scaling of Setpoint value output default is no scaling Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com a 96s ferorin noerron 1 owp TT VISA Resource OUT Setpoint Value double current value of setpoint after Set operation if applicable error out Connector Pane Setpoint SF 1 Operation Get YISA Resource port GUS Device Address EG aia Desired Setpoint ar ill error in Scaling 1 0 VI
5. panel showing Timer Range and time values controls Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com ee 6 Library Reference Each of the subVis in the VI library is shown on the VI Tree vi block diagram in Figure 13 this VI is not executable The VIs in the library and the VI Tree vi can all be accessed by right clicking on the block diagram of a new VI choosing User Libraries and opening the C Series Controller palette as shown before in Figure 1 As shown in Figure 13 the subVis in the VI library are divided into different categories approximately indicating their usage in communicating with the Device The Vis in the Configuration and Action Status categories use the Set Get property to read or write configuration values The Vis in the Data category are used to read or write data values such as the value of the Input or the Count Most of the subVis in the VI library perform functions described in the user manual for the device A listing of the functions of each of the subVis in the library follows categorized by the CUB5 series device to which they apply These descriptions for each subVI are also contained in the VI documentation for each individual subVI This can be easily viewed by turning on the LabVIEW context help the button in the upper right of the block diagram window and hovering with the mouse over each of the subVI icons or by accessing the VI properties F CUB5 Series Ivlib V
6. CUB5 Series Communication VI Library User Manual Version 1 0 VISA resource name Port To CUBS ae hun am READ Baud Rate 9600 0320 Device Address usi CUBS Series 100 g0 CUBS CUBS CUBST CUBS CUBST We E 2 A hatte CUBS CUBES ae l THITIALIZ je TRE CUBS f CUBS jl CUBS p CUBS p DO a gt Ydy Sey Copyright 2009 Integrated Pro http www integratedpro com TABLE OF CONTENTS CUB5 SERIES COMMUNICATION VI LIBRARY 1 Introduction 2 Installation 3 Communications Setup Finding the Communications Port Finding the Controller Address and Serial Baud Rate 4 Using Example Vis CUB5 Counter Example Query Device vi CUB5 Timer Example Query Device vi CUB5 Counter Example Panel and Log vi CUB5 Timer Example Panel and Log vi CUB5 Analog Example Panel and Log vi 5 Creating Custom VIs A Basic VI Application Adding More Functionality Changing Configuration Values Timer Formats 6 Library Reference Vis for All Devices Vis for CUB5 Counter VIs for CUBST Timer Vis for CUB5 CUB5I CUBSRT CUB5P Analog Meters 7 Optional Parameters Optional Timing Parameters Optional Scaling Value Notices Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 1 Introduction This VI library contains VIs Virtual Instruments and example code for implementing communication between LabVIEW from National Instrum
7. CUBS oo om Figure 1 CUBS Series library Vis under User Libraries on the Tools Palette CUB5 Timer Example Query Device vi The purpose of this VI is to query the settings of the CUB5 timer at the address you provide and to report this in text form The front panel of this example VI is shown in Figure 3 To run this example VI follow the instructions on the front panel The VI will execute a single time and the Status Information will report some status and configurable settings of the panel meter for example the current values for the Timer and Cycles Timer Start value Timer Stop value and Cycle Count Start value This information is also shown on the indicators on the right hand side of the front panel CUB5 Counter Example Panel and Log vi The purpose of this VI is to simulate the front panel of the CUB 5 counter showing the Count and Rate values Trend values of Count and Rate are logged to a chart on the front panel at about every second The front panel of this example VI is shown in Figure 4 Follow the instructions on the front panel The VI executes in a loop with an event structure controlling the update rate and responding to user input from the front panel controls By default the VI will only retrieve the values of Count and Rate By turning the Write Enable switch ON the VI can be used to set the Count using the Update Count numeric control Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www in
8. EW Help menu It is recommended that you Mass Compile the VI library to make sure that the VIs are compiled in your version of LabVIEW and that all of the Vis link to their necessary suVIs Open the Mass Compile dialog from the Tools gt Advanced gt Mass Compile menu and navigate to the folder LabVIEW user lib CUB5 Series where LabVIEW represents the folder where LabVIEW is installed Make sure you are inside CUBS Series folder and choose Current Folder then Mass Compile Note that the message Bad VI VI Tree CUBS series vi is expected this VI is not intended to be operational but only to present the subVis in categories Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 3 Communications Setup Before using the VI library you need to know three things 1 Which communications port your RS 485 serial interface is using to communicate with the Controller You can then use this information to set the VISA Resource which LabVIEW will use to communicate with the controller 2 The address of the Controller on the RS 485 serial bus This will be a number between 1 and 255 3 The serial baud rate By default this is set to 9600 baud Other serial settings should be set to 8 bit data No parity and 1 Stop bit Finding the Communications Port To find out this information consult the documentation for your RS 485 serial interface Most RS 485 serial interfaces install under Windows
9. I Tree CUB5 series vi Block Diagram File Edit View Project Operate Tools Window Help Me Gn Ss ba amp os CUB5 Series Panel Meter Communications YI Library WI Tree Initialize Configuration Action Status Data Utility Close CUBS CUBS CUBS CUBS CUBS cues CUBS CUBS CUBS CUBS CUBS i ary 7 3 Enslog 7 DP EN BY i E analog HAAR COUH fay THER Sens la TNITIALIZ SETGET SET GET RESET RESET arab pean TREAD CLOSE CUBS CUBS 1 cues CUBS CUBS CUBS og pasiogi J dD oy oy RATE Hi PC YCLE SET GET SETGET RESET AD TREAD READ AT PT r r Bo my J COUHT TIHER SET GET SET GET RESET WRITE WRITE GU S CUBS j e SET GET WRITE CUBS SOF SET GET CUBS STO SETGET Copyright 2008 2009 Integrated Pro gt ALL RIGHTS RESERVED Figure 13 VI Tree vi block diagram showing library subVis Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 18 Vis for All Devices Block Print CUB5 vi Requests a block print string from the device The content of the reply string will depend on the User Input Function Setup Parameters on the actual device see CUB5 manual An Optional Timing cluster input is included to vary the delay after the request until the response is read to allow the entire string to be transmitted Depending on length of the reply string you may wish to adjust the Optional Read Delay value of this cluster The default delay is 1 second Error checking i
10. Range which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set according to the actual device setting so that the timer value is interpreted correctly Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs eo O VISA Resource Port Required Device Address 132 Device address on RS 485 bus Required Operation enum device for example MMM SS SS Desired Timer Setpoint OFF Value 132 error in no error Outputs ee VISA Resource OUT Timer Setpoint OFF Value 132 current value of timer setpoint OFF value after Set operation if applicable error out Connector Pane Operation Get Timer Range YISA Resource port LUES WISA Resource OUT Device Address gj a ae kime values Desired Timer Setpoint OFF string error in error out Set or Get Timer Start Value CUBST vi Use this VI to get or set the value of the Timer Start Value TST on the timer The input value is a 7 digit integer and is interpreted by the device according to the Timer range as set on the device Signs are disregarded all numbers are treated as positive values The range of the 7 digit integer is checked to be between 9999999 and 0 and an error is returned if Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com ey ee out of range Note that for mixed unit rang
11. SA Resource QUT Current Setpoint error out Write Count CUBS5 vi Writes desired count value to Counter specify Counter A or Counter B with input The desired count value is divided by scaling value default 1 0 to correspond to the counter scaling factor and converted to 116 before being written Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs VISA Resource Port Device Address 132 Counter enum value output default is no scaling Desired Count double Pass error in no error Outputs o VISA Resource OUT ass thru error out Connector Pane Counter CTA YISA Resource port Device Address Desired Count error in Scaling 1 0 VISA Resource QUT error out Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com aD Vis for CUB5T Timer Format Timer Value CUBST vi Formats Time Value for Write Timer vi Set or Get Timer Start Value vi Set or Get Timer Stop Value vi from individual Day Hour Minute Second unit values This VI checks ranges on individual unit values for instance max 59 seconds max 999 hours etc Returns error if out of range Wire error output from this VI to error input of Write Timer vi Set or Get Timer Start Value vi Set or Get Timer Stop Value vii if used to keep Write Timer CUB5 vi from executing if the inputs are out of range Requires input Timer Rang
12. Update Count r 1 ESTE Write Error Tj En j Address Lt OMe 9600 bps eee error out Instructions Choose appropriate serial port using VISA resource Set the Baud Rate and Counter Address status code to correspond with counter settings Running the VI causes the panel values to update approximately every FI D 1 0 seconds with values from controller Count and Rate are logged to graph Display can be changed between Count and Rate by using Sel button Count value can be changed by changing the value of Source Update Count or reset by using RST value if Write Enable is ON fuse care in writing to a controller that is currently operational Use STOP to quit Figure 4 CUBS Counter Example Panel and Log VI front panel Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 10 CUBST Timer Example Panel and Log Time a Cycles Fn Timer Range VISA Resource port Baud Rate f f Write Error Seconds 5555555 i Timer L COMS 1 9600 bps F Address 2 xl E kead Error error out Instructions Choose appropriate serial port using VISA resource Set the Baud Rate and Timer Address status code to correspond with timer settings Running the VI causes the panel values to update approximately every 4 0 1 0 seconds with values from controller Time and Cycles are logged to graph Display can be changed between Time and Cycles by using Sel button Time value can be reset by using EST value sourc
13. ant to be starting points for verifying communication and for use in creating your own custom VIs It is assumed that the CUBS series device is properly wired and configured for communication Example VIs can be accessed either under CUBS Series library on the LabVIEW Help menu or from the Tools Palette right click on the block diagram On the Tools Palette choose the CUB5 Series panel meter palette under User Libraries as shown in Figure 1 When you drop one of the example VIs on a block diagram it will automatically open to show the front panel CUB5 Counter Example Query Device vi The purpose of this VI is to query the settings of the CUB5 counter at the address you provide and to report this in text form The front panel of this example VI is shown in Figure 2 To run this example VI follow the instructions on the front panel The VI will execute a single time and the Status Information will report some status and configurable settings of the panel meter for example the current values for the Count and Rate the Scale Factor and Count Load value value loaded on reset This information is also shown on the indicators on the right hand side of the front panel Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 3 Functions a Search F Programming z Select a VI 43 User Libraries B CUES I A 4 CLUBS Series CUBS CUBS CUBST cues CUBST pe rr EG TCUES p CUBE CUBSp
14. as a standard serial port such as COM5 COME6 etc In Windows you can view the installed serial ports under the device manager MAC OS and Linux have similar utilities Finding the Controller Address and Serial Baud Rate On the CUB5 series panel meters the Controller address and serial settings are found using the Serial settings programming menu press and hold the SEL button until the programming menus appear press the RST button to enter programming mode and then use the SEL button to choose the Serial settings programming menu Consult the CUB5 panel meter manual for further details All devices on the RS 485 serial bus must use the same serial baud rate but have different addresses LabVIEW acts as a serial Master device and the Controller acts as a Slave device The VI library only supports RTU mode not ASCII communications Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 4 Using Example VIs Example VIs are included with the VI library including e CUB5 Counter Example Query Settings vi e CUB5 Timer Example Query Settings vi e CUB5 Counter Example Panel and Log vi e CUB5 Analog Example Panel and Log vi e CUB5 Timer Example Panel and log vi These Vis are contained in the folder LabVIEW VexamplesVCUB5 series where LabVIEW represents the path to your LabVIEW installation They demonstrate how to use the subVis contained in the VI library to communicate with the panel meter and are me
15. e use caution in writing to a controller that is currently operational Use STOP to quit Figure 5 CUB5 Timer Example Panel and Log VI front panel CUBS alah jalna JA kue Je Ag Meter Example Panel and Log Meter Value 0 15 28 Oy 15 33 OF Time 24 HH MM 55 a E VISA Resource port Baud Rate Meter re rrome 7 9600 bps Read Error STOP error out Instructions Choose appropriate serial port using VISA resource Set the Baud Rate and Meter Address to correspond with meter settings Running the VI causes the panel values to update approximately every 0 1 0 seconds with values from controller Use STOP to quit status code SOUrCE Figure 6 CUB5 Analog Meter Example Panel and Log VI front panel Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 5 Creating Custom VIs After using the example VIs to verify communications between LabVIEW and the device you can use the VI library to create your own custom VIs or modify the examples Here is a simple example showing how to use a few of the library VIs to develop a custom VI CAUTION The VI library can change the configuration setpoint or other operating parameters of your device s and or other devices connected to the RS 485 bus resulting in changes to device behavior and especially if the device is connected to a physical process i e operational and controlling something Never experiment with an operat
16. e which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set according to the actual device setting so that the timer value is interpreted correctly inputs o VISA Resource Port Pass thru only so VI can be wired in front Ms es device for example MMM SS SS value perrorin noerror 1 TT Outputs 1 TT perrorout 1 TT error out Connector Pane Timer Range q CUBS time values Format l Timer Timer value error in ees ly error out Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 28 Read Cycles CUB5T vi Reads current cycle count of timer CUB5T Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs o O VISA Resource Port Device Address 132 Device address on RS 485 bus Required error in no error Outputs VISA Resource OUT Cycle Count 132 error out Connector Pane YISA Resource port CUBS VISA Resource OUT Device Address Bu Cycles error in error out Read Timer CUBST vi Reads current value of timer CUB5T Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Requires input Timer Range which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set accordi
17. e action of the setpoint under reset conditions depends on counter setup see Manual Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts o Cerrorin noero 1 SSS foupus SSS error Connector Pane Setpoint SP YISA Resource port CUBS VISA Resource OUT Device Address s re error in RESET error out Set or Get Scale Factor CUB5 vi Use this VI to get or set the value of the scale factor specify Counter A or Counter B with input The value of the scale factor must be within the limit of the counter This is NOT checked by this VI The current setpoint is always returned by this VI Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com ao eae The desired scale factor is a six digit positive number with assumed 4 decimal places and the returned scale factor value is shifted 4 decimal places to become a six digit positive number after being read For example a desired scale factor of 1 000 must be entered as an 132 value of 10000 and a returned scale factor 132 value of 200 corresponds to a count scale factor of 0 0200 on the device see Counter documentation Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts o errorinfnoero pp TT error in no error Outputs PG VISA Resource OUT Scale Factor 132 current scale factor value after Set
18. e and Controller Address controls can be easily created by right clicking on the appropriate VI inputs on the block diagram and choosing Create gt Control from the right mouse click menu When correctly wired the front panel and block diagram should look similar to Figure 7 and Figure 8 Set the VISA resource name Baud rate and Device Address Save the VI and run it The value shown on the front panel in the example shown Count should now correspond to the value on the CUB5 series panel meter Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com Untitled 1 Front Panel 9600 bps VISA resource name Port Baud Rate 9600 Device Address Seles Figure 8 Basic Application VI block diagram Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 12 243 Adding More Functionality The basic pattern for the subVIs on the block diagram is always similar to that shown in the simple example except that the Initialize CUB5 vi and Close CUB5 vi subVis are only called at the beginning and end of the program and only once for any particular RS 485 serial bus even if there are multiple Controllers To further illustrate things let s add a timed loop to read the values of the input to the CUB5 device Using the Basic Application VI as a starting point save it as a new VI if you would like add a timed loop found on the Timed Structures subpalette o
19. ents and a Red Lion Controls CUB5 series panel meter via RS 485 serial bus The CUB5 series includes several different types of panel meters including the CUB5 counter CUB5T timer CUB5V DC voltage meter CUB5I DC current meter CUBSRT Temperature meter and CUB5P Process Meter 4 20mA Communication between LabVIEW and CUB5 series panel meter allows expanded capabilities such as the ability to log and trend the panel meter value or to remotely change the configuration values on the meter A single instance of LabVIEW running on a PC can access multiple panel meters and other devices throughout an installation via the RS 485 bus to provide a central view or coordinated control and data acquisition capability at very low cost The CUB5 device requires an optional serial interface that is available from Red Lion Controls in order to communicate via serial Although recommended for RS 485 serial communication these VIs can also be used with RS 232 serial or USB serial communication if that type of interface is used Because addressing is not supported by RS 232 serial or USB serial communication this applies only to a single CUB5 device that is directly connected to the PC It is assumed in this document that the reader is familiar with how to program and use LabVIEW Hardware and wiring are beyond the scope of this document If you need help setting up the RS 485 serial bus please consult the user manual for the panel meter your RS 485 serial
20. es including seconds or minutes where the maximum value for a unit is 59 this check is not sufficient For example the value 9999999 will be clipped to 9995959 by the device if the timer range on the device is HHHMMSS Use Format Timer Value vi to format the Timer Start Value number according to a specific timer range which should be chosen to correspond to the timer range on the device and check individual unit values The current Timer Start Value is always returned by this VI Requires input Timer Range which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set according to the actual device setting so that the timer value is interpreted correctly Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts o TT Timer Range enum Set to one of 18 timer modes as set on device for example MMM SS SS error in no error Desired Timer Start Value 132 Desired Timer Start Value Outputs VISA Resource OUT Timer Start Value 132 current value of timer start value after Set GENER if applicable error errorout ses Connector Pane Operation Get Timer Range WISA Resource port CUBS VISA Resource OUT Device Address Me ae time values Desired Timer Start value string error in error out Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com
21. f the Structures palette to control how often the values read from the device are updated Leave the default timing values 1000ms update and don t forget to add a STOP button control You can add other VIs from the Data sub palette of the CUBS series library if you would like for instance Read Rate CUB5 vi in the example shown Your front panel should look similar to Figure 10 Notice that the VISA resource and error wires are connected through all the subVis from left to right and that each individual library VI in the middle of the program requires the Device Address input If you have multiple controllers on your RS 485 serial bus you can call them individually by simply changing the controller address input on the given subVI Running the VI should cause the values shown on the front panel to update approximately once per second to match the values on the front panel of the Device P simple example vi Front Panel File Edit View Project Operate Tools Window Help om A YISA resource name Port 4 COMS v Baud Rate 9600 ZT 9600 bps Device Address 26 Figure 9 Simple Example VI front panel Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 14 af af l PEK File Edit View Project Operate Tools Window Help sin Weal Bo 12 Applicaton Font ir Tv ML pa mane T CUBS CUBS il E gm a UHITIALIZ FREAD CUBS CUBS ae ond ger READ READ CUBS CUBS ae eu KAN
22. fore replying based on this character which is part of the command string written to the device 50ms recommended for RS 485 and 2ms recommended for RS 232 or USB only both of which can only be used with a single device on a direct connection Optional Scaling Value Some of the SubVis that read or write the input value of the Device or that adjust configuration parameters relating to the input value of the Device such as Read Count CUB5 vi have optional scale factor inputs The default scaling value is 1 0 Unless you have a good reason for doing so it is not recommended to change these values however if you do you should make sure that all VIs having this input terminal receive the same value scale factor Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com Notices All trademarks are property of their respective owners Usage in this document of trademarks not owned by Integrated Pro is only to facilitate understanding on the part of the reader and no ownership or association is implied Information furnished by Integrated Pro is believed to be accurate amp reliable No responsibility is assumed however by Integrated Pro for its use whether correct or incorrect nor can Integrated Pro be held liable for consequences or any infringements of patents or other rights of third parties which may result from its use Information in this document is current as of date of writing and is subject to c
23. hange Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com
24. interface documentation or one of the numerous references on the internet More information about LabVIEW is available at http www ni com labview and RS 485 references are also available at http www integratedpro com CAUTIONI The VI library can change the configuration setpoint or other operating parameters of your device s and or other devices connected to the RS 485 bus resulting in changes to device behavior and especially if the device is connected to a physical process i e operational and controlling something Never experiment with an operational device for development purposes it is recommended to only use an offline device on an isolated RS 485 serial bus until you have thoroughly verified functionality and safety in your application Integrated Pro is not affiliated with Red Lion Controls Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 2 Installation Install the VI library by running the installation program setup exe Choose the installation directory and review the Software License Agreement The VI library installs under the most current version of LabVIEW Be sure to review the Readme txt file information at the end of the installation Restart LabVIEW after installing so that the library VIs will show up on the Tools palette right click the block diagram You can find them on the CUB5 series palette under User Libraries You can access help and example VIs under the LabVI
25. ional device for development purposes it is recommended to only use an offline device on an isolated RS 485 serial bus until you have thoroughly verified functionality and safety in your application A Basic VI Application Start with a blank VI and open the CUBS Series VI pallettes by right clicking on the block diagram of the new VI choosing User Libraries from the Tools Palette and opening the CUB5 series Controller palette as shown in Figure 1 Make it stay open Pinning the palette click the push pin icon in the upper left hand corner of the CUBS series Controller palette Drag the Initialize CUB5 vi and Close CUB5 vi onto the block diagram Now open the Data sub pallette Depending upon which type of device you have if your device is a CUB5 counter then drag Read Count CUB5 vi onto the block diagram or if your device is a CUB5T timer then drag Read Timer CUB5T onto the block diagram or if your device is a CUB5V CUB5I CUB5RT or CUB5P then drag the Read Input CUB5 Analog vi onto the block diagram Arrange the VIs on the block diagram as shown in Figure 7 CUB5 counter example shown You can view the connector pane for each of the subVis by turning on the LabVIEW context help the button in the upper right of the block diagram window and hovering with the mouse over each of the icons Notice that there are required inputs on some of the subVls so connect these up to a control or a constant The VISA resource name Baud Rat
26. ity 1 Stop bit with Termination Character disabled with port timeout of 10 seconds Other settings are at default for the platform Also stores global Optional Timing Parameters to be used in RS 485 communications These values specify values specific to RS 485 modbus communications that are to be used throughout the program Unless you have a good reason for doing so it is not necessary to change these values Max Retries 5 The number of times the program will retry automatically after receiving a serial communication error Optional write delay 20ms The modbus specification requires that the RS 485 serial bus be quiet between transmitted messages These delays are based on the baud rate Often it is desirable to insert additional delay to account for noise slow settling slow device response or other factors This optional delay is inserted before the required minimum delay before a message is written Optional read delay 20ms see above This optional delay is inserted before the required minimum delay before a reply is read Device read timeout 200ms Specifies how long to wait for a reply from the device before retrying This is a programmatic delay and not the same thing as the VISA serial port timeout Termination Delay Character 50ms CUB5 devices determine how long to wait after receiving a command before replying based on this character which is part of the command string written to the device 50ms reco
27. lue is not written and an error is returned The current Cycle Count Start Value is always returned by this VI Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts o TT Desired Cycle Count Start Value 132 error in no error Outputs o TT VISA Resource OUT Cycle Count Start Value 132 current value of cycle count start value after Set operation if applicable error out Connector Pane Operation Get WISA Resource port CUBS VISA Resource OUT Device Address E oa is Cycle Count Start Value Desired Cycle Count Start W error out error in Set or Get Setpoint Time out Value CUBST vi Use this VI to get or set the value of the Timer Setpoint Time out Start STO Value on the timer When writing the input is assumed to be in the format MM ss ss where the decimal points are Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com me ignored see device manual The value of the Timer Setpoint Time out Value must be within the 6 digit limit of the counter or the value is not written and an error is returned The current Timer Setpoint Time out Value is always returned by this VI Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs o O MM ss ss format decimals ignored Terrorin noero SOS Outputs o O VISA Resource OUT Timer Setpoint Time ou
28. mmended for RS 485 and 2ms Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 20 recommended for RS 232 or USB only both of which can only be used with a single device on a direct connection Inputs o O Choose VISA resource corresponding to serial port you are using Required Baud Rate Select the baud rate corresponding to the settings on the Process Controller Required Optional Timing Parameters typedef TT Errorin noero 1 Outputs o TT perrorout o Connector Pane WISA resource name Port GUD WISA resource name out al Baud Rate 9600 a aran Desired Optional Timing Par error in no error Vis for CUB5 Counter Read Count CUB5 vi Reads count from Counter specify Counter A or Counter B with input Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts S TT Scaling value double Optional input to adjust scaling of Counter value output default is no scaling This value can be used to set the decimal place if desired errorin noerron 1 TT Outputs o perrorout o Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 2 4 Connector Pane Counter CTA YISA Resource port CUBS VISA Resource OUT Device Address Be coy Count error in error out Scaling 1 0 Read Rate CUB5 vi Reads Rate from Counter Error checking is used If e
29. ng to the actual device setting so that the timer value is interpreted correctly Inputs pa device for example MMM SS SS Outputs 1 VISA Resource OUT Timer Value typedef cluster double Cluster output of Days Hours Minutes Seconds Content will depend on the value read from the device as interpreted by the Timer Range input Wire only valid values Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 290 per timer range input used string out string timer string read from the device useful for debugging error out Connector Pane Timer Range YISA Resource port CUBS VISA Resource OUT Device Address gt THER time values error in rm BE string error out Reset Cycles CUBST vi Resets cycle count from timer CUB5T The value of the cycle count after reset will depend on the counter start parameter on the device see CUB5 manual Read the count using Read Cycles vi after calling this VI to verify reset Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs VISA Resource Port Device Address 132 Device address on RS 485 bus Required error in no error Outputs VISA Resource OUT error out Connector Pane YISA Resource port CUBS VISA Resource OUT Device Address ante error in ml RESET error out Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www in
30. ot execute if error Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com se puts o perrorin noerror 1 TT Outputs o TT perrorout o Connector Pane YISA Resource port CUBS VISA Resource OUT Device Address Desired Cycle Count ih error out error in Write Timer CUBST vi Writes desired cycle count value to Timer CUB5T Error checking is used If error input is wired this VI checks for previous errors and does not execute if error The input value is a 7 digit integer and is interpreted by the device according to the Timer range as set on the device Signs are disregarded all numbers are treated as positive values The range of the 7 digit integer is checked to be between 9999999 and 0 and an error is returned if out of range Note that for mixed unit ranges including seconds or minutes where the maximum value for a unit is 59 this check is not sufficient For example the value 9999999 will be clipped to 9995959 by the device if the timer range on the device is HHHMMSS Use Format Timer Value vi to format the Timer Write number according to a specific timer range which should be chosen to correspond to the timer range on the device and check individual unit values puts o TT perrorin noerror 1 Outputs S TT VISA Resource OUT error out Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com mer Connector Pane YISA Resou
31. r Stop Value 132 current value of timer stop value after Set operation if applicable error out Connector Pane Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 36 Operation Get Timer Range YISA Resource port CUBS VISA Resource OUT Device Address gi N aie kime values Desired Timer Stop value l string error in error out Time Values to String CUBST vi Formats Timer Values from individual Day Hour Minute Second unit values into a string value that matches the display format on the device This VI checks ranges on individual unit values for instance max 59 seconds max 999 hours etc Returns error if out of range Requires input Timer Range which corresponds to one of the 18 possible timer ranges for example MMM SS SS on the front panel of the device This needs to be set according to the actual device setting so that the timer value is interpreted correctly Inputs of other Write VIs device for example MMM SS SS Time Values cluster typedef seconds error in no error Outputs VISA Resource OUT Timer String string formatted time values display string error out Connector Pane Timer Range CUBS time values Timer kime string ko error in essa Sting error out Write Cycles CUBST vi Writes desired cycle count value to Timer CUB5T Error checking is used If error input is wired this VI checks for previous errors and does n
32. rameters to be used in RS 485 communications These are values specific to RS 485 communications that are used throughout the program They can be modified through an input cluster on the Initialize CUBS5 vi but unless dictated by such factors as electrical interference on the RS 485 bus for instance it is generally not necessary nor is it recommended to change these values Max Retries 5 The number of times the program will retry automatically after receiving a serial communication error Optional write delay 20ms The specification requires that the RS 485 serial bus be quiet between transmitted messages These delays are based on the baud rate It may be desirable to insert additional delay to account for noise slow settling slow device response or other factors This optional delay is inserted before the required minimum delay before a message is written Optional read delay 20ms see Optional write delay above This optional delay is inserted before the required minimum delay before a reply is read Device read timeout 200ms Specifies how long to wait for a reply from the device before retrying This delay is a programmatic delay and not the same thing as the VISA serial port timeout which will return an error in the case of hardware or other failure and cause the subVI not to retry but rather to return the error Termination Delay Character 50ms CUBS devices determine how long to wait after receiving a command be
33. rce port CUBS VISA Resource OUT Device Address TIHER i WEITE Desired Timer value SEE error out error in Vis for CUB5 CUB5I CUBSRT CUB5P Analog Meters Set or Get Setpoint CUB5 Analog vi Use this VI to get or set the value of the setpoint on analog models of panel meter specify Setpoint 1 or Setpoint 2 with input The value of the setpoint must be within the limit of the counter This is NOT checked by this VI The desired setpoint is divided by scaling value default 1 0 to correspond to the meter scaling factor and converted to 116 before being written The current setpoint is always returned by this VI Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts S TT value RR default is no scaling error in error in no error error Outputs VISA Resource OUT Setpoint Value double current value of setpoint after Set operation if applicable error out Connector Pane Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 39 Setpoint Analog SPA Operation Get YISA Resource port Device Address Desired Setpoint JI i error in Scaling 1 07 YISA Resource QUT Current Setpoint error out Read Input CUB5 analog vi Reads current value of the input on analog models CUB5V CUB5I CUB5P CUB5TC CUB5RT Error checking is used If error input is wired this VI checks for previous e
34. rror input is wired this VI checks for previous errors and does not execute if error Inputs S O VISA Resource Port Device Address 132 Device address on RS 485 bus Required Scaling value double Optional input to adjust scaling of Counter value output default is no scaling This value can be used to set the decimal place if desired errorin noerron 1 TT Outputs PG perrorout S TT Connector Pane WISA Resource port CUBS VISA Resource OUT Device Address HRA Rate error in error out Scaling 1 09 Reset Counter CUB5 vi Resets count from Counter specify Counter A or Counter B with input The value of the counter after reset will depend on the Input Setup Parameters on the actual device see CUB5 manual Read the count using Read Counter vi after calling this VI to verify reset Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts o Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com a2 VISA Resource Port Device Address 132 Device address on RS 485 bus Required Set to choose Counter A or Counter B error in no error Outputs o perrorout o Connector Pane Counter CTA YISA Resource port CUBS VISA Resource OUT Device Address ae error in nn RESET error ouk Reset Counter Setpoint CUB5 vi Resets the Counter Setpoint Output specify Setpoint 1 or Setpoint 2 with input Th
35. rrors and does not execute if error Inputs o O value output default is no scaling Scaling value double Optional input to adjust scaling of Counter value output default is no scaling This value can be used to set the decimal place if desired errorin no erro 1 TT Outputs o TT perrorout o Connector Pane YISA Resource port CUBS VISA Resource OUT Device Address a Input Value error in error out Scaling 1 07 Read MaxMin CUB5 analog vi Reads current MAX or MIN value of the input on analog models CUBSV CUB5I CUB5P CUBSTC CUB5RT This feature must be enabled on the meter see Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 40 manual Error checking is used If error input is wired this VI checks for previous errors and does not execute if error VISA Resource Port Device Address 132 MAX MIN enum Maximum Scaling value double Connector Pane MaxiMin Max YISA Resource port CUES Device Address a En error in Scaling 1 0 VISA Res error out Reset MaxMin CUB5 analog vi Device address on RS 485 bus Required Specifies whether to read Max or Min value on meter Optional input to adjust scaling of Counter value output default is no scaling Max Min value on meter if enabled ource QUT Max Min Value Resets the Maximum or Minimum value on analog models of panel meter specify Setpoint 1 or Setpoint 2
36. s used If error input is wired this VI checks for previous errors and does not execute if error Inputs o O VISA Resource Port Device Address 132 Device address on RS 485 bus Required Optional Timing Parameters optional Use to adjust the read delay between sending the block print request and receiving the reply string Cerrorin noero Output S VISA Resource OUT Block Print Reply String received from the device in response to the block print request perrorout Connector Pane rs485 Optional Timing Param YISA Resource port Device Address VISA Resource QUT Block Print Reply error out Close CUB5 vi Terminates the software connection to serial port Call this VI to make sure the serial port is closed at the end of your application puts o VISA resource name Port Choose VISA resource corresponding to serial port you are using Required perrorin noerror 1 TT Outputs Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 19 errorout o Connector Pane CUBS WISA resource name error in no error ses CLOSE error out Initialize CUB5 vi Initializes Serial Communications on given port at chosen baud rate Returns error if unsuccessful Call this VI before calling other Vis but generally you need to call the Initialize VI only once at the beginning of an application Uses the following serial port settings 8bit data No Par
37. ss Desired Cycle Count Start Value Figure 11 Using Set Get property to read or write configuration values Timer Formats The CUB5T Timer device can display time values in a number of formats on the front panel of the device Internally on the device all of these formats are converted to a 7 place unsigned integer value and the decimal place if any shown on the front panel of the device is assumed according to the format chosen in the Device setup menu This makes it necessary to use an assumed choice for the Timer Range input when displaying the time value as shown on the actual CUB5T device in LabVIEW Additionally the VI Library uses a typedef cluster named Time Values containing individual numeric controls for the values of Days Hours Minutes and Seconds as an input and output of subVis that read and write time values to and from the CUB5T Timer Device and the time values are converted to and from the device format as required The Timer Range input and the Time Values cluster are shown on the front panel shown in Figure 12 Several VIs are provided for manipulating the time formats and values These are illustrated in CUBST Timer Example Panel and Log vi and CUB5T Timer Example Query Device vi example applications Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com CUBS Series vlib Read Timer CUBST vi Front Panel File Seconds 5555555 Figure 12 Read Timer CUBST vi front
38. t Value enum current value of timer setpoint time out typedef value after Set operation if applicable error out O O STO string string actual string returned from the timer Connector Pane Operation faet WISA Resource port CUBS WISA Resource OUT Device Address A Timer Setpoint Time out Value Desired Timer Setpoint Time ae string error in error out Set or Get Timer Setpoint OFF Value CUBST vi Use this VI to get or set the value of the Timer Setpoint OFF Value SOF on the timer The input value is a 7 digit integer and is interpreted by the device according to the Timer range as set on the device Signs are disregarded all numbers are treated as positive values The range of the 7 digit integer is checked to be between 9999999 and 0 and an error is returned if out of range Note that for mixed unit ranges including seconds or minutes where the maximum value for a unit is 59 this check is not sufficient For example the value 9999999 will be clipped to 9995959 by the device if the timer range on the device is HHHMMSS Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 336 Use Format Timer Value vi to format the Timer Setpoint OFF value number according to a specific timer range which should be chosen to correspond to the timer range on the device and check individual unit values The current Timer Setpoint OFF Value is always returned by this VI Requires input Timer
39. tegratedpro com 30 Reset Timer CUBST vi Resets timer CUB5T The value of the timer after reset will depend on the timer start parameter on the device see CUB5 manual Read the count using Read Timer vi after calling this VI to verify reset Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs VISA Resource Port Device Address 132 Device address on RS 485 bus Required ferrorin noerror 1 TT Outputs ji eroro ji Connector Pane WISA Resource port CUBS VISA Resource OUT Device Address ee error in ml RESET error out Reset Timer Setpoint CUB5T vi Resets timer setpoint CUB5T per Setpoint Assignment on the Device see manual Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs VISA Resource Port Device Address 132 Device address on RS 485 bus Required error in no error Outputs o VISA Resource OUT error out Connector Pane Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com se YISA Resource port CUBS VISA Resource OUT Device Address Pan error in sen RESET error ouk Set or Get Cycle Count Start Value CUBST vi Use this VI to get or set the value of the Cycle Count Start CST Value on the timer The value of the Cycle Count Start Value must be within the 6 digit limit of the counter or the va
40. tegratedpro com kom vi Figure 2 CUB5 Counter Example Query Device VI front panel gem r 2 f Seconds 5555555 Figure 3 CUB5 Timer Example Query Device VI front panel Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com CUB5 Timer Example Panel and Log vi The purpose of this VI is to simulate the front panel of the CUB5 timer showing the Time and Cycle Count values Trend values of Time and Cycle Count are logged to a chart on the front panel at about every second The front panel of this example VI is shown in Figure 5 Follow the instructions on the front panel The VI executes in a loop with an event structure controlling the update rate and responding to user input from the front panel controls CUB5 Analog Example Panel and Log vi The purpose of this VI is to simulate the front panel of the CUB5 Analog Meter DC Voltage DC Current Temperature or Process Meter showing the Input value Trend values of the Input are logged to a chart on the front panel at about every second The front panel of this example VI is shown in Figure 6 Follow the instructions on the front panel The VI executes in a loop with an event structure controlling the update rate and responding to user input from the front panel controls CUB5 Counter Example Panel and Log Count e Rate ein Time 24 HH MM 55 aj ae VISA Resource port Baud Rate Write Enable
41. tual device setting so that the timer value is interpreted correctly Error checking is used If error input is wired this VI checks for previous errors and does not execute if error Inputs o device for example MMM SS SS error in no error 1 Outputs o Timer Setpoint ON Value 132 current value of Setpoint ON value after Set operation if applicable error out HE Connector Pane Operation Get Timer Range YISA Resource port LUES VISA Resource OUT Device Address j time values Desired Timer Setpoint OM Y w i SELGET string error in error out Set or Get Count Load Value CUBS vi Use this VI to get or set the value of the Count Load Value for Counter A The value of the Count Load Value must be within the limit of the counter This is NOT checked by this VI The desired Count Load Value is divided by scaling value default 1 0 to correspond to the counter scaling factor and converted to 116 before being written The current count load value is always returned by this VI Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com p Error checking is used If error input is wired this VI checks for previous errors and does not execute if error inputs o TT Scaling value double Optional input to adjust scaling of Setpoint value aan default is no scaling error in error in no error error KE EE VISA Resource OUT a ss Resource OUT Pass Pass thru sss Count Load
42. with input Max Min must be enabled on the meter and the action of the setpoint under reset conditions depends on panel meter setup see Manual Error checking is used If error input is wired this VI checks for previous errors and does not execute if error VISA Resource OUT error out Copyright O 2009 Integrated Pro ALL RIGHTS RESERVED Device address on RS 485 bus Required Set to choose to reset MAX or MIN http www integratedpro com A1 Connector Pane MaxiMin Max YISA Resource port CUBS VISA Resource OUT Device Address error In af HET error out Reset Setpoint CUB5 analog vi Resets the Setpoint Output on analog models of panel meter specify Setpoint 1 or Setpoint 2 with input The action of the setpoint under reset conditions depends on panel meter setup see Manual Error checking is used If error input is wired this VI checks for previous errors and does not execute if error puts 1 TT error in no error Outputs VISA Resource OUT perrorout 1 Connector Pane Setpoint Analog 5P14 YISA Resource port CUBS VISA Resource OUT Device Address etal error in RESET error out Copyright 2009 Integrated Pro ALL RIGHTS RESERVED http www integratedpro com 42 7 Optional Parameters Optional Timing Parameters Initialize CUB5 vi is used to open communications between LabVIEW and the RS 485 bus It also sets global values for the Optional Timing Pa
Download Pdf Manuals
Related Search
Related Contents
Gebrauchsanleitung Instruction manual Mode d`emploi Handleiding - Teledyne LeCroy "取扱説明書" Rheem 2-Stage Specification Sheet Fiche à télécharger Copyright © All rights reserved.
Failed to retrieve file