LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB Command

I am really new to Lab Windows CVI platform so I hope some one can help I am working with the Test Equity oven - to read the oven temp I have to send an command speciifed by the manufacturer as follow: Command: "R? 100, 1" Response fTemp //fTemp resprensets ASCII numberic characters converted to float type With the stand ard GPIB/GPIB 488.2 Library I am able to read the Hart sensor temp successfully using the following code { char sensor_temp[501] = {0}; double actual_temperature; write_IO ("FI=0", hart_temp_sensor); //set filter to 0 write_IO ("U=C", hart_temp_sensor); write_IO ("ST=OF", hart_temp_sensor); write_IO ("T", hart_temp_sensor); Delay (0.1); query_IO ("FETCH?", hart_temp_sensor, sensor_temp); actual_temperature = atof (sensor_temp); // convert char to float return actual_temperature; } How do I read the oven temperature?
0 Kudos
Message 1 of 3
(4,471 Views)

I guess something like query_IO("R? 100, 1", &temperature) could work.  But without the source  code for the query_IO() function, we don't know what this function really does and there might be an error in this function.

You allready tried  to communicate with the oven manually using the "communicate with instrument" utility in Measurement and Automation Explorer. ?

0 Kudos
Message 2 of 3
(4,421 Views)

Thank you for your suggestion.  I found the answer after a while.  Basically I can use the library I/O write function ibwrt to write the read command as follow

ibwrt (oven_id, buffer, (long) length); with the buffer is the command "R? 100,1<lf>"

then I will have to read the return value by using the provide command as follow

ibrd (oven_id, read_data, 100); read_data is the char array that will contain the result from address 100 of the oven

Thank again for your time.

 

 

 

0 Kudos
Message 3 of 3
(4,397 Views)