Hi, from the command wiki
In pipeline mode, measurement tasks and processing tasks are handled separately (in a "measurement task sequencer" and a "processing task sequencer") and executed concurrently
It's not clear to me if in this code SerialOut is always executed before SerialIn or not:
SerialOpen(ComC3,38400,3,0,138,4)
Scan (50,mSec,100,0)
SerialOut (ComC3,"?Q",&H02,0,2) 'open poll request
SerialInRecord (ComC3,row2,&H02,0,&H0D0A,n2,01)
SerialOut (ComC3,"!","",0,0) 'close poll request
NextScan
In the terminal I see the commands in the following order: ?Q, ! , row2. And 20 ms between ?Q and row2. The data is still collected correctly.
I don't understand why with the modified code like this:
SerialOpen(ComC3,38400,3,0,138,4)
Scan (50,mSec,100,0)
SerialOut (ComC3,"?Q","",0,0)
SerialInRecord (ComC3,row2,&H02,0,&H0D0A,n2,01) '2 and 3 ascii char or &H02
NextScan
I continue to see the command ?Q and 20 ms after the Row2 response. Why exactly 20ms if I have not set any delay or timeout?
If SerialOut and SerialIn are considered one Process and the other Measure, how is sequentiality maintained in pipelinemode?
Thanks
To pair with SerialInRecord, use SerialOutBlock. With the right conditions, both run in the digital measurement task. There are notes in the CRBasic help for those instructions.
This post is under review.