LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

start signal using RS232

Hi all,

 

Im building a VI to automate a signal-reading from different vectors by rotating the sender of the signal. it works like this:

1. The interface print receives a ready signal and procedes to the starting position.

2. When the rotor is ready, the interface sends my VI a signal to start the series of measurements.

3. When the measurements are finished, my VI sends a signal to the interface which in turn sends a signal to the rotor to procede to the next position

4. repeat from step 2 until the final position is reached, in which case the interface sends a "done" signal

 

I'm using a RS232 connection (using the "instrument I/O assistant") and i worked out how to send and receive the information required, but the question is:

How can i get my program to work when I get the ready signal, because the program runs even when nothing is received?

And how do i get my program to send the required information when my measurements are done?

 

please help me 🙂

Ho

0 Kudos
Message 1 of 4
(2,571 Views)

Your problem sounds like the definition of a state machine architecture 🙂

 

There are some examples in the example finder.

_____________________________
- Cheers, Ed
0 Kudos
Message 2 of 4
(2,570 Views)

Hello Ho,

 

Thank you for your post on our webforum. I think it is best to start with a example; basic and advanced serial write and read examples are installed with NI Visa. This is a good starting point.

 

The settings with those VI's are depending on your hardware you are trying to control. I think in what you described the basic Visa VI's are a better solution; only one VISA session will be used with writing and reading. With I/O assistant it is all in once; for each action a new Visa session will be created.

 

I hope this will help you further,

 

Best regards,

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 3 of 4
(2,530 Views)

The basic serial communication examples will help you to understand how to communicate with the instrument.  You can try out one command at a time.

When implementing your complete solution you should use a State Machine architecture.  Look for examples on the forum.  There should be some that include serial communication.

 

R

0 Kudos
Message 4 of 4
(2,519 Views)