Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial write problem

Hello,

               I have problem with my serial write. I have cluster of elements which always used to write to the serial device(many devices of same kind and everytime I use only one device to play from labview). I am using JKI state machines in my program. So, in some states, I need to change the memory type(RAM or EEPROM)and address in existing cluster elements. All the program is written in a while loop but serial open and close vi's are used out to the while loop. In some states I updated the cluster elements with bundle by name VI. Though, if change mt serial device to another device, then , EEPROM write is generating error. Once, if shutdown whole labview and reopens run well for only one device. I need to shutdown lh abview for each device. I don't know why this is happening. Even I checked with option Probe option which shows correct cluster elements. Can some one help me.

0 Kudos
Message 1 of 3
(3,065 Views)

One of the issues is that the VISA open is outside of the loop and you are using a tunnel to bring the VISA session into your while loop. Every iteration of the while loop will supply the VISA session that was fed into it from outside of the loop. If you change that to a shift register, you can close the VISA session and open another one INSIDE the while loop and talk to a different device.

 

The same will hold true for your cluster of elements. Every iteration of the loop, it will have the information from outside of the loop. Nothing from one iteration to the next.

 

Some VIs were missing, but here is a change to your VI showing using shift registers instead of tunnels.

 

I also couldn't resist some quick re-factoring. Nothing changing the functionality, but remember - straight lines can be your friends.

 

     Rob

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

Here it is with the modification that all errors are handled

no connector connections yet.

greetings from the Netherlands
0 Kudos
Message 3 of 3
(3,038 Views)