02-07-2006 01:10 PM
Hi,
I’m creating a VB.NET application which requires synchronization between analog inputs and a displacement measure (50000 pulses / meter) – displacement speed : 1m/s.
Used hardware
When the measurement is authorized (one input on 6528), I need acquire simultaneously, for a 10 meters displacement
To be continued …
02-07-2006 01:13 PM
VB.NET code structure
User controls are autogenerated and instancied into the main form
To be continued …
02-07-2006 01:16 PM
The callback looks like
Public Sub OnMyDataReady(ByVal Sender as Object, ByVal e as UC_TskDisplacement.TaskEventArgs)
‘ Called when data are available
‘ Access analog data
AI=TskAnalogInputs.Read()
‘ Store data into structure
Str_Acq(idx).Time=environment.TickCount ‘ time (ms)
Str_Acq(idx).Displacement=e.GetData(0) ‘ displacement
Str_Acq(idx).Analog0=AI(0) ‘ AI0
Str_Acq(idx).Analog2=AI(1) ‘ AI2
idx=idx+1 ‘ idx is a table index (integer)
End Sub
To be continued …
02-07-2006 01:18 PM
Str_Acquisition is a structure defined as :
‘ Acquisition informations
Private structure Str_Acq
Dim Time as integer
Dim Displacement as Double
Dim Analog0 as double
Dim Analog2 as double
End Structure
To be continued …
02-07-2006 01:19 PM
I’m able to separately :
but when trying to synchronize the whole, I loose counts (precision is divided by 50 – the smallest displacement measure I can see is 1 mm) !
I think the callback access counter and AI too slowly, but I don’t know how to change this to get the right precision (20 µm).
Can you help me ?
Thanks,
“Pas bavard”
02-07-2006 01:43 PM
I'm only a LabVIEW user and can't comment usefully about any of the VB.net code. However, I DO think you should change the following:
Used hardware
- PCI 6528 (get/set digital I/O)
- PCI 6220 (analog inputs)
- PCI 6602 (displacement)
- RTSI cable between 6528 and 6220
I don't think the RTSI connection on the 6528 does you any good. However, if you were to connect the 6220 (analog in) to the 6602 (displacement), then you could accomplish synchronization in hardware.
It sounds like your approach so far is to depend on software polling to take individual readings one at a time. You'll be capable of much higher measurement rates if you instead let the data acq boards buffer your readings.
In LabVIEW this would be a pretty straightforward. I don't know how one would approach it with VB.net.
-Kevin P.
02-08-2006 02:02 AM
Hi Kevin,
Thanks for the answer.
I will take a look on the RTSI cable.
It sounds like your approach so far is to depend on software polling to take individual readings one at a time. You'll be capable of much higher measurement rates if you instead let the data acq boards buffer your readings.
I do that because I haven't found what I need on forums nor in DAQmx examples (I found for a simple counter, not displacement counters). I'm OK to use the board to buffer readings, but how can I do that with my application ? How can I route the counter signal to the analog board and get the counter value at the same time ?
In LabVIEW this would be a pretty straightforward. I don't know how one would approach it with VB.net.
Yes, but I have no choice : VB.NET or nothing ...
Thanks,
"Pas bavard"
02-10-2006 07:48 AM
02-10-2006 07:48 AM
02-10-2006 07:48 AM