LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using Visa and get some value is that possible to get these values in text

I modified visa read and write example and added something to control two power meter and tempererature controller in same program. In program I am getting value from these 3 device and i want to put these data in text automatically is that possible which section i should use or read to do that. The software was attached and also program working picture is attached to show how my data are. and also in attached jpg i described one problem i really do not understand and i am still looking for it.

Download All
0 Kudos
Message 1 of 10
(2,639 Views)

And also i am getting kind of warning in visa read section it is 1073676294, software is working but i do not know why it gives this error or warning? it says OK(1073676294).

0 Kudos
Message 2 of 10
(2,633 Views)

Under the Strings pallete there are VIs for converting numbers to text and text to numbers.

 

I suspect you will have problems with your program since you have two loops within a another loop. The outer loop will not be able to exit until both inner loops complete. I am not sure why you wrapped those two loops with another loop.



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 3 of 10
(2,624 Views)

Actually this program is kind of duplicating programs. I have a vi example to cntrol just for one power meter and i duplicate this codes to control two power meter and then. For temperature controller i used basic visa read and write example but i changed some part of it. Actually i put all of these codes in one while loop but it did not work and the i made two while loop one is for power meters and second one is for temp controller and it works and i hope i do not face any problem for it. 

0 Kudos
Message 4 of 10
(2,619 Views)

@mkmo wrote:

<snip>

...i hope i do not face any problem for it. 



mkmo - If you are hoping that you don't have problems, it might be a good time to read some tutorials on data flow and instrument communications.  I know that NI tends to propagate the notion that anyone can program in LabVIEW, but to be an EFFECTIVE LabVIEW programmer, you need to know LabVIEW as well as general programming fundamentals - just like any other programming language.  🙂

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.
Message 5 of 10
(2,610 Views)

Gernally loops within loops need to be looked at carefully, especially if you have parallel loops within a single loop. Inner loops of nested loops should do specific tasks where it is known that they will run a finite number of times. Loops that end on user input generally should not be nested inside other loops.



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 6 of 10
(2,609 Views)

ok thank you for your replying, i changed loops and put all codes in just one while loop if you mean that.

0 Kudos
Message 7 of 10
(2,601 Views)

@mkmo wrote:

ok thank you for your replying, i changed loops and put all codes in just one while loop if you mean that.


No, not really. You are monitoring separate sensors and as such I would see it reasonable for each one to have its own loop. What I am saying you should do is then place those loops within another loops. The beauty of LabVIEW is that it is very easy to create parallel tasks. Simply create two loops next to each other. Each will run independent of the other. However when you place both within another loop they only run independent of eacho other for a single iteration of the outer containing loop. the outer loop will not be able to continue until both loops complete. This means that the two loops are no longer independent of each other since one will be stalled if it completes until the other also completes.



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 8 of 10
(2,595 Views)

probably i do not understant what you wrote but i attached the jpg file and i have question about that in this part i set temperature and also i am reading actual temperature but the problem is i do not want to read set temperature just want to read actual temperature but when i run program it read both even i deleted visa read part not to read set temperature. Is this about loop? and how i can make them working independently? also i attached jpg for front panel of program to show what i am saying.

Download All
0 Kudos
Message 9 of 10
(2,593 Views)

@mkmo wrote:

probably i do not understant what you wrote but i attached the jpg file and i have question about that in this part i set temperature and also i am reading actual temperature but the problem is i do not want to read set temperature just want to read actual temperature but when i run program it read both even i deleted visa read part not to read set temperature. Is this about loop? and how i can make them working independently? also i attached jpg for front panel of program to show what i am saying.


After looking at the image of your VI, I am repeating my advice about reading up on instrumentation control and data flow!!!  For instance, the hallmark of not understanding communications is the "Wait (ms)" primitive.  This usually means you don't really understand how the instrument is communicating (with LabVIEW or any other programming language).  In this case, the "Wait (ms)" can be eliminated in two different ways: either a) by enclosing the VISA read and the Bytes at Port" in a while loop that keeps reading the buffer until it is dry, or b) by using the termination character to automatically stop the read when the termination character is encountered.  (I'd lean towards the latter, since it appears this instrument communicates using some subset of SCPI commands.)  Plus, what happens if the two T/F case structures both want to write to the serial port at the same time?  Did you realize you are closing the same VISA session twice?

I would NOT recommend trying to implement ideas put forth here without understanding the WHYs, because that is just asking for trouble.

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 10 of 10
(2,560 Views)