FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it practical to generate two seperate sub vi's when using labview to communicate with fieldpoint, one for inputs and one for outputs and both opening the same iak file at the same time?

When using LabVIEW with FieldPoint, there are two common interfaces that can be used. There is the "legacy" interface consisting of the FP Open, FP Create Tag, FP Read, FP Write, FP Advise, and FP Close VIs, or there is the "LabVIEW 7+" interface consisting of the FP Read, FP Write, and FP Advise VIs used with the FieldPoint IO Point named tag.

In either case placing FP Reads in one subVI and FP Writes in another subVI is very easy to do, and offers few problems. In the "LabVIEW 7+" case, it is extremely easy to do as you can place the FieldPoint IO Point constants (or controls) in the subVI and not have to worry about passing refnums from VI to VI. The "legacy" mode is slightly more complicated in that the FP Open creates the server refnum (which is a subset of the FieldPoint Refnum) which is required as an input to the FP Create Tag VI which in turn creates the tag refnum value. It is permissible but generally considered poor programming to have multiple FP Open VIs in a LabVIEW program, which means that the FP Open should be done prior to calling the input and output subVIs.

The primary gotchas to avoid are:
1) Placing a for loop around an FP Write to auto-index an array of FieldPoint IO Point constants with the On Change input set to True. The problem with this approach is that the On Change input (when true) compares the last value written to the current value and only writes if the value is different. However, when the VI is called in a loop with different FieldPoint IO Point values, the comparision is performed against the last value which was for the previous channel rather than the last value for the same channel.
2) Using the FP Close VI to stop the server when one set of VIs is still using the server (e.g. read loop stops but write loop keeps going).

Regards,
Aaron
LabVIEW Champion, CLA, CPI
0 Kudos
Message 2 of 2
(3,065 Views)