LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Several visa read, write and close

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.

0 Kudos
Message 1 of 8
(3,150 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 8
(3,145 Views)

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.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 8
(3,134 Views)

I've had very clean code, but mixed up in my thinking.Smiley Very Happy

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 8
(3,120 Views)

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???

0 Kudos
Message 5 of 8
(3,109 Views)

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???

0 Kudos
Message 6 of 8
(3,108 Views)

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.

0 Kudos
Message 7 of 8
(3,100 Views)

You can't use two read or write VISA twice & make them parallel.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 8
(3,065 Views)