Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66787

best way to initialise serial comms in a state machine

$
0
0

Hi everyone, I have a motion reference unit (Microstrain 3DM-GX1) that I am trying to communicate with serially. I have used the serial example VI's to talk to it and everything works fine using the VISA configure serial port function.

Now I am trying to build an application around this using a standard state machine architecture and I wanted to know what is best practice for initialising my COM port.

1. Where should my VISA configure serial port code go, to the left of the while loop so it gets initialised once, or inside a "start" state, that will also run just once.

2. I have states that read and write to the serial port as the program runs, I am passing the VISA resource name with shift registers to the states that need it, is this OK?

3. I have a VISA close function outside the while loop on the right hand side being fed from the shift register, is this OK?

 

I have added my project so far if you need to see what I'm talking about, If there are any other glaring errors, feel free to let me know.

 

Many thanks

 

Karl


Viewing all articles
Browse latest Browse all 66787

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>