Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Polled sensor serial in pipelinemode


FedeJack Nov 4, 2025 02:51 PM

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


JDavis Nov 4, 2025 10:49 PM

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.


JDavis Nov 4, 2025 11:33 PM

This post is under review.

Log in or register to post/reply in the forum.