LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help my labview program

I want to use GPIB write and read to acquire data from two channel simultanously, I compiled a program, but it doesn't work. I don't know how to fix it. When I ran the program, a Error window poped up.
 
Could someone look at my program to see what happened? Thanks!
 
LL
0 Kudos
Message 1 of 13
(4,014 Views)
How to fix the problem of GPIB write and read?
Thanks
0 Kudos
Message 2 of 13
(4,007 Views)
It would hep if you could attach your program. 🙂
 
What do you mean by "compiled a program"? What did the error windows say?
0 Kudos
Message 3 of 13
(4,008 Views)
Sorry, I haven't done GPIB ofr over eight years, but a few things stick out with regard to execution order and dataflow.
 
Have a look at the inner sequence frame #2: You simultaneously send two GPIB READ and two GPIB WRITE commands, all at the same time. Since there is no data dependency between these four nodes, it is completely unpredictable in which order they execute. It is possible that you read first, write later.
 
A great way to ensure proper execution order is to string them along the error cluster. Feed the "error out" of the first node to the  "error in" second node and so on. Maybe you even need some small delays.
 
All the boolean logic in inner sequence frame 0 calculates to FALSE. What's the point?
 
You convert an integer to EXT. Why?
Message 4 of 13
(4,006 Views)
"A great way to ensure proper execution order is to string them along the error cluster. Feed the "error out" of the first node to the  "error in" second node and so on. Maybe you even need some small delays."
 
Could you show me a sample? How to string them together?
 
For other questions, there is no problem to run it, someone told me to do that, so I don't have comment on that. Sorry about that. But I know when I read data one channel by one channel, which means GPIB write and read one channel first and then to do another channel, there is no problem to get data, which is not what I need. It is very important for me to acquire data from two channels at the same time.
 
I don't know how to send two command "?1, ?2" together and then read it at the same time.
 
thanks.
0 Kudos
Message 5 of 13
(3,994 Views)
You don't understand. It's important for you to acquire data at the same time. It's completely irrevelant (and not possible) to do two reads at the same time. The instrument needs to be set up so that both channels take a measurement when triggered. As long as that happens, you can read the channels sequentially.
Message 6 of 13
(3,984 Views)
For my instrument; I set up synchronization with trigger signals when two channels acquire data.  when trigger signal come into the the instrument, the two channel will record the signals at the same time. I use pulse trigger signals.
 
Thanks
0 Kudos
Message 7 of 13
(3,977 Views)

You cannot send multiple commands "at the same time" to the same device via GPIB.

Maybe your device allows stringing of multiple commands with a single write. Maybe there is a command to read all channels? Check the manual. Sorry I'm not very familiar with GPIB.

Basic dataflow dictates that a node can only execute once all inputs have data and will only produce outputs once it is done. Thus the error cluster ensures that the second node must wait until the first has completed successfully and so on.

BTW: you also don't need these numeric indicators (read output x). Just right-click on the charts and select "visible items..digital display". I would also recommend to get rid if all these unecessary sequence structures, they make the diagram hard to edit and debug. Again proper execution order is ensured with the error cluster.

Attached is a quick attempt at a code cleanup to give you some ideas. Most likely it will need quite a few more changes.

Some other ideas:

  • You can replace the "division by 8" with a "right-shift by 3 bits".
  • What determines the timing of the while loop? Don't you need some timing?
Message 8 of 13
(3,974 Views)
There is a scan command, when I send the command, the instrument will scan all channels (8), and then to read data for channels. There is another question that is I have to send two command to get scanned data for two channels. How to do is another puzzle for me? I To scan and to synchronize is done by program.
 
Thanks
0 Kudos
Message 9 of 13
(3,970 Views)
Scan implies a sequential measurement. I'm not sure what you are asking for now. You first say that you have to send two commands to fetch the data and then you say that how to do it is a puzzle. Please explain what exactly you need. If it's something instrument specific, you have to provide the make and model of the instrument you are using if you want any help.
0 Kudos
Message 10 of 13
(3,919 Views)