12-06-2012 10:45 AM
In my visa program, I am using 2 visa read, write and I close my visa section twice that can be seen in picture that I' ve attached. Is that possible to make them in one visa read, write and close session. In software, I order two command one is to change temperature and second command is to see actual temperature in controller. To order tow command do I need one visa write and close session for each one, or can I do them in only one visa write and close visa one time instead of closing visa for each command.
12-06-2012 10:54 AM
You will run into issues doing it the way you have written it. As suggested in another of your posts look into using a state machine. This will allow you to control the actions of your application and control when things occur. As you have written it is underterministic which command will be written first. If you decide mot to use a state machine at least use data flow to control when the writes will occur and in which order. Simply wire them together in a straight line. Use the write to send your first command. Wire the error out and VISA out to the next write with your second command, and so on.
12-06-2012 11:41 AM
May I also suggest to clean up your code often - that is straighten up all the wires and make labels meaningful. it's like indenting in C. Yeah the code runs just fine without it, but it is infintely more difficult to read and you'd be very prone to mistakes if you didn't do it. Besides, I believe a cleaner style promotes more organized thinking... But that's just a theory, because I've had mixed results. 😉
12-06-2012 01:19 PM
I've had very clean code, but mixed up in my thinking.
12-06-2012 01:54 PM
in Labview, how i can divide visa's, for example first change wavelength to 140, and the after this complish then show me laser wavelentgh which structure can i use to do that???
12-06-2012 01:54 PM
in Labview, how i can divide visa's, for example first change wavelength to 140, and the after this complish then show me laser wavelentgh which structure can i use to do that???
12-06-2012 02:14 PM
As already said, use a state machine (File>New...Frameworks>Design Patterns) or simply sequentially wire up your VISA functions. The VISA Write is connected to a VISA Read by connecting the VISA Resource Name Out of the VISA Write to the VISA Resource Name of the VISA Read. Do the same thing with the Error Out to the Error In.
12-10-2012 01:20 AM
You can't use two read or write VISA twice & make them parallel.