LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write DO Read DI boolean array

This is a repost of my message originally posted to the TestStand Forum.     
 
 
Hello,
 
I am trying to build a test application to exercise Compact FieldPoint cFP-DO-403 and cFP-DI-302 modules.  I have my hardware configured correctly through MAX, and have been able to write values to the cFP-DO-403 board and can see that outputs are enabled through the status LEDs on the module.  Additionally I am able to run the FP Getting Started "Digital Output.vi" and "Digital Input.vi".
 
My application will be similar to these Getting Started examples where I want to be able to write values to the cFP-DO-403 to enable
output channels, and read values from the cFP-DI-302 to see state changes.
 
Similar to the "Digital Output.vi", I'd like to have a control that is made up of multiple toggle switches (or some other button interface), but I am unsure of how to do this.  
 
I wired a "I/O Field Point Const" (with all ports from the cFP-DO-403 selected) to the "FieldPoint I/O Point In" input of a "FP Read (Polymorphic).vi".   I then created a control wired to the "values" input of the "FP Read (Polymorphic).vi", selecting its type to "FP Write (Boolean Array - IO)". 
 
After creating these connections in the LabView Block Diagram view, I see that a single push button was placed on the LabView Front Panel for this VI that has an edit control tied to it allowing the user to choose the index for which output they wish to control when selecting the button.  This works fine, but I'd rather be able to have a bank of buttons, one for each output channel.  How do I change this interface?  Do you have any documentation that would walk me through this process? 
 
Alternatively, I'd like to be able to write input values based on a user defined variable that would change during loop iterations.  Can you explain how to do this also?
 
Once I'm able to write to the cFP-DO-403, I then want to read values from the cFP-DI-302 module to enable indicator LEDs showing Input state changes.  Any additional information you have to do this would also be appreciated.  I assume that I will be creating some type of container for both the multi-button input control and multi LED output indicator.
 
Thank you for your assistance.
 
Bob Bamberg
0 Kudos
Message 1 of 2
(3,181 Views)
In the future, please ask FieldPoint Questions in the FieldPoint Forum.  Some other NI employees that work with FieldPoint are more likely to notice questions here, so you may get a quicker answer.

To create this control:

1.  Go to your front panel and place an array onto it.  Array is located at Modern»Array, Matrix & Cluster»Array.
2.  Drag and drop a Modern»Boolean»Vertical Toggle Switch into the empty array. 
3.  Hold your cursor over the right boundary of the array until it turns into a left/right arrow, then click and drag it to the right until you get the number of booleans that you would like to display.
4.  To make the control look more like the Digital Output Example, right-click on the array and select Visible Items»Index Display to disable the index display that appears on the left.
5.  Find the control on the block diagram, and wire it to the FP Write VI.

The LEDs in the Digital Input VI is almost the exact same process, except that you drag the array down, and place in boolean LEDs into the array.

Trey B
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(3,159 Views)