From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

send serial command in VBAI based off of calculation

I am attempting to send serial commands through VBAI based off of a previous calculation step. For instance, my application will determine an objects mass center and then determine if it is to the left or right of my origin. From here, I would like to be able to send a serial command based on the left/right result. The command will be sent to an arduino which will controll a servo left or right based on the command it recieves. I think I have everything but linking to serial command to the calculation result figured out here. Any feedback or help with this would be greatly appreciated.

0 Kudos
Message 1 of 2
(3,874 Views)

In the Serial step, when you are sending a command (i.e. you press the "Send Command" button), you can press the "Insert Result" button to have the serial command you send out conatin a result from a previous step. There are even formatting options so you can have numeric previous measurements formatting into the string as you want. If you need to send results from other states, you can use variables to pass data between states since the Serial step doesn't currently support accessing results from other states.

 

Hope this helps,

Brad

0 Kudos
Message 2 of 2
(3,863 Views)