Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

expected time to complete an ibwrite.

Solved!
Go to solution

I have a question regarding the "expected" time to complete a call to ibwrite.

 

Here is a code snippet... This code works well however the question I have is in regard to the time required to complete the call...

The timing data below was collected using an HP XW8600 with dual NI488.2 installed running RedHat (RHEL) 5.1. with the NI-488.2 2.5 - Linux - Beta 32 Bit driver with gcc 4.3.3.

 

I would be very interested in anyone elses performance on Win32/Linux platforms while using NI and/or 3rd party drivers.


Code snippet which produced this timing...

Note variable mIEEE488SpirentGPS.dataToWriteOut is a string which is approx 200 chars in length.


case IEEE_488_IBWRT:

// start write timer
StartTimer( 2, writeCaseTimerName );   // Starting a timer (0.6us to start/stop)

// write data to GPIB
if( ( status = ibwrt( mIEEE488SpirentGPS.unitDescriptor,
                              (char *)mIEEE488SpirentGPS.dataToWriteOut,
                              mIEEE488SpirentGPS.writeCount ) ) & ERR )
{
// place error in member error message parameter & report error to user
     HandleIbwrtError( SPIRENT_GPS_BOARD_IDENTIFIER, status,

                                   (char *)mIEEE488SpirentGPS.dataToWriteOut,
                                   fileAndFunctionName,

                                   (char*)mIEEE488SpirentGPS.errorMessage );
     break;
}

// stop write timer
StopTimer( 2 );    // Stop timer (0.6us to start/stop)

 

Here is the timer data dump after the run...

Note an avg, min, max time of 38.9ms, 1.4ms, and a 67.6ms (respectively) to complete a call to ibwrite.

See below for a histogram of the call times...
 
#### avg/min/max timer data for timer(2) ####
Name of timer: IEEE_488_B_Local::RealTimeSpirentGPSTask - Write case
Average looping time (seconds): 0.038902582920
Minimum looping time (seconds): 0.001380000000
Maximum looping time (seconds): 0.067578000000

Average rate for Power Supply real time loop: 25.705234 Hz
Number of loops: 1007
Error happened in StartTimer: false
Error happened in StartTimer: false
 
The histogram data indicates that 999 calls (out of 1007) took between 10-50ms and

8 calls took between 50-100ms with the worst case being 67.6ms.

All of this is consistent however this is way too slow for the planned update rate to this device.

 

Are these results consistent with other peoples experience/timing on other platforms ?

 

I need to have a worst case duration of 3ms (with 1ms of margin) in order to achieve a 250hz message rate.  All comments or suggestions are welcome...

Do I need to switch to scramnet ?  That is my only other option for this device.

 

#### histogram data for timer(2) ####
sim_uut_timer.report histo t00,c00 : 0.000000000 : 0
sim_uut_timer.report histo t01,c01 : 0.000000100 : 0
sim_uut_timer.report histo t02,c02 : 0.000000500 : 0
sim_uut_timer.report histo t03,c03 : 0.000001000 : 0
sim_uut_timer.report histo t04,c04 : 0.000005000 : 0
sim_uut_timer.report histo t05,c05 : 0.000010000 : 0
sim_uut_timer.report histo t06,c06 : 0.000050000 : 0
sim_uut_timer.report histo t07,c07 : 0.000100000 : 0
sim_uut_timer.report histo t08,c08 : 0.000500000 : 0
sim_uut_timer.report histo t09,c09 : 0.001000000 : 0
sim_uut_timer.report histo t10,c10 : 0.005000000 : 0
sim_uut_timer.report histo t11,c11 : 0.010000000 : 999
sim_uut_timer.report histo t12,c12 : 0.050000000 : 8

sim_uut_timer.report histo t13,c13 : 0.100000000 : 0
sim_uut_timer.report histo t14,c14 : 1.000000000 : 0

0 Kudos
Message 1 of 5
(3,996 Views)
What kind of GPIB controller are you using? PCI-GPIB, GPIB-USB?
Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
0 Kudos
Message 2 of 5
(3,972 Views)

We are using two brand new pci-gpib ni 488.2 controllers...

If I have one controller in the host the timing numbers are the same...

0 Kudos
Message 3 of 5
(3,959 Views)
I would recommend benchmarking by writing from one PCI-GPIB controller to the other instead of to the instrument to get the most accurate numbers.  Your results don't seem out of line for what I have seen for other instruments.
Ben

National Instruments
Certified LabVIEW Associate Developer
Certified TestStand Developer
0 Kudos
Message 4 of 5
(3,955 Views)
Solution
Accepted by topic author bhazzard

Ben,

  Thanks... when we did our developent/timing tests last week we were using an HP power supply as a "stand in" device for the real device and apparently power supplies are very slow to reply...

We tested with the real device today and all of the ibwrt's completed in under 70us ...this is much better than the 68ms I get with the power supply.

This is the timing I was expecting...

We did try the  controller to controller  test and that showed simular results with a worst case of ~66us.

 

Thanks for the help... 

 

0 Kudos
Message 5 of 5
(3,940 Views)