Enter Your Project for a chance to win a grand prize for the most innovative use of Arduino or a $200 shopping cart! The Birthday Special: Arduino Projects for Arduino Day! | Project14 Home | |
Monthly Themes | ||
Monthly Theme Poll |
To celebrate Project 14's birthday, I'm going to make a programmable switch with an Arduino UNO. This post describes the second block for the LabVIEW driver: Read Status. In the previous posts I reviewed the Inialize and Switch Control blocks. This post does not alter the behaviour or cause an action. We read back the status of the relays via LabVIEW. |
Read Status
This is a data block. You ask the Arduino what the status is of a particular relay.
This block accepts two parameters and returns one value:
- Channel (1|2): the relay that will be controlled by this block
- Read Delay (ms): how long do we wait for the Arduino to answer.
- Enabled (true|false): status of the particular relay.
The flow is comparable to the previous one, except that we use a different SCPI command and that we add a data read block.
The left part prepares the SCPI command. Once it's constructed, it will be like this: :DIGITAL:SWITCH1?.
The middle block is a configurable wait. This should be set to allow the Arduino to verify the status and send the reply back.
The right side of the flow reads the status from the Arduino. Only when the reply is ON\n, we report TRUE. Else the block returns FALSE.
Here's an example that shows how to use the block: