LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about labview control of oriel monochromator 74100 GPIB read

Hi,

 

I am trying to write a labview code which could control our monochromator from oriel newport. But I am facing a problem. I really don't understand what the "byte count" on GPIB read function. And shall I get a number (0,1,2) to the mode terminal?

 

I am a starter. Could somebody help me out?

 

Thanks

0 Kudos
Message 1 of 8
(4,106 Views)

First, use VISA and not the lower level GPIB functions.

 

The bytes count is simply how many bytes you want to read. Assuming the instument is compliant with IEEE 488.2, you just set this to some high number and the read will automatically terminate when EOI is detected and you will get all of the data.

0 Kudos
Message 2 of 8
(4,098 Views)

Thanks. But could you make it more clear. I just started to learn it this week. I could use the GPIB write function to give a command to monochromator which let it change the wavelength. I also want it to reponse to me what is the current wavelength it think is. So I first send a command "GO WAVE 500", for example, which I could do it now. There is another command "WAVE?' , which will tell the monochromator to response a number? Could it be read through GPIB read function?

 

I am trying to use GPIB functions because I am able to do the simillar thing to Keithley 2400. I connect a number "100" to the "byte count' on GPIB read and it works. I found it from some other people's programe online, Really don't know why "100", I tried "16" doesn't work, which seems to be big enough for me.

 

 

I never used the VISA. So does't have to be done in this way. why GPIB won't work.

 

Thanks

0 Kudos
Message 3 of 8
(4,091 Views)

VISA is the preferred api because it is portable. You can use it with other vendor's GPIB cards and (mostly) unchangrd with other communication connections such as serial, ethernet, usb, etc. You simply use a VISA Write instead of a GPIB Write and a VISA Read instead of a GPIB Read.

 

When you do a query, you often do not know how many bytes the instrument will return but it really does not matter. When an instrument is done sending, it will assert the control line EOI. So, if you request, or example, 100 bytes but the instrument only sends 10, the read will terminate when the 10 bytes are read because the GPIB and VISA Reads are designed to look for the EOI. Specifying a large number to read is seldom a problem. Specifying too few is.

 

With the GPIB mode input, you don't have to provide anything if the instrument is compliant to current IEEE specifications. If it uses something other than just EOI, then the manual will say so.

0 Kudos
Message 4 of 8
(4,085 Views)

Hi, I read some about the VISA. It get something but it too slow and sometime freeze. Also it also send out an error. I attacthed two pictures one is using VISA. Another is using GPIB. Could you or someone tell me what's wrong with those?

Download All
0 Kudos
Message 5 of 8
(4,063 Views)

You are opening and closing the VISA resource on every iteration of your loop.  Worse than that, you are doing it twice in the same loop, so those two pieces of code running in parallel are going to step all over each other.

 

Open your VISA resource, before your while loop.  Close it after.  Inside your loop, do your write and read commands in order by wiring all of the VISA resources and Error wires together.  Write "Filter?", then read the port, then write "Wave?", then read the port again.

0 Kudos
Message 6 of 8
(4,049 Views)

I tried to add a sequence staced case over the while loop and open VISA before and close it after. But it still stuck there. I highlight the process and found it stuck at VISA read for a long time to give a number and still send of a error message whose code is -1073807339.

 

Thanks

0 Kudos
Message 7 of 8
(4,036 Views)

Don't do either GPIB or VISA operations in parallel. The bus does not work that way. You never need to use a sequence structure and around the while loop makes no sense.

 

Try sending the query in MAX before writing any code. Your timeout error indicates a wrong command or the instrument simply has no data to send.

0 Kudos
Message 8 of 8
(4,025 Views)