Discussion:
NI-DAQ-6229 Speed With VB.NET
(too old to reply)
RRobertH
2008-07-29 23:40:08 UTC
Permalink
I'm using a Ni-DAQ 6229 Card and programing it via VB.NET 2005 but am having a speed issue.The Main Setup (Not showing Everything)[code]    Public AbortOut As DigitalSingleChannelWriter    Public Red_in As DigitalMultiChannelReader    Public Abort_Out As Task    Public Ready_In As Task    Public RNull as booleansub setup()        Abort_Out = New Task("AbortControl")        Ready_In = New Task("ReadyLine_IN")        Abort_Out.DOChannels.CreateChannel("DAQ_01/port1/line1", "Abort_Out", ChannelLineGrouping.OneChannelForEachLine)        Ready_In.DIChannels.CreateChannel("DAQ_01/port1/line3", "Ready_In", ChannelLineGrouping.OneChannelForEachLine)        Red_in = New DigitalMultiChannelReader(Ready_In.Stream)        AbortOut = New DigitalSingleChannelWriter(Abort_Out.Stream)end subSub TimeTest()        AbortOut.WriteSingleSampleSingleLine(True, (1))        RNull = Red_in.ReadSingleSampleSingleLine(0)        AbortOut.WriteSingleSampleSingleLine(True, (0))        RNull = Red_in.ReadSingleSampleSingleLine(0) End Subprivate sub Button1_click        TS = (Now.Minute * 60 + Now.Second) * 1000 + Now.Millisecond        For I = 1 To 10000            TimeTest()            'TestStatus.Value = I / 40        Next        TE = (Now.Minute * 60 + Now.Second) * 1000 + Now.Millisecond        MsgBox(Str(TE - TS))end sub[/code]The timing is quite slow though (Running on a vista Box with 4 Gig of Ram / AMD 64X2 4600Loop Value 10,000 No Sets / Reads       = 3-5 msNo Sets / 1 Read      = 1856 msNo Sets / 2 Reads    = 3543 ms1 Set / No Reads      = 2097 ms2 sets / no reads      = 4021 ms2 Sets / 2 Reads      = 7561 msMy Question is how can I speed up the Writing to the Digital Port & The Reading of the Port so that it's faster than 0.18ms per read & 0.2ms per write ?I'm using it for controlling an external device, and it has to watch the digital lines to go high to start it's test, and returns on the read line when the test is finished.
dansch
2008-07-31 01:10:08 UTC
Permalink
Hello Everyone,This customer has contacted National Instruments for support.  We will post the final solution once the issue has been resolved.Regards,
RRobertH
2008-07-31 18:40:27 UTC
Permalink
When I add this change, I get a speed up, but not enough.private sub Button1_click        Trigger_Out.Start()        Abort_Out.Start()        For I = 1 To 10000            TimeTest()        Next        Trigger_Out.Stop()        Abort_Out.Stop()end subBut when I add this change, the systems get out of sync, and it appears as though it's getting false readings.But only when I "Start" the reading (Ready_In / Trigger_In) Functions.If I don't "start" them, and just use the read function (that starts & stops the channel each time it's called) then the two systems stay in sync.private sub Button1_click        Trigger_Out.Start()        Abort_Out.Start()        Trigger_In.Start()        Ready_In.Start()        For I = 1 To 10000            TimeTest()        Next        Trigger_In.Start()        Ready_In.Start()        Trigger_Out.Start()        Abort_Out.Start()end sub
RRobertH
2008-07-31 21:10:09 UTC
Permalink
Ok, that spead it up, the DAQ software was actually getting ahead of the Keitley TSP Script.
Thanks, the Start / Stop commands helped.
 

Loading...