From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Commands multiplexing

Solved!
Go to solution

Hello there,

 

I have a weird RS232 device that sends back a lot of different values.

 

I have to send a specific command to get each value (like "AS001k" for the first one "AS002l" for the second...).

 

I manage to use global string variables and a slope generator to send one by one each command. (see attached sheet). I don't need to be fast.

 

But I didn't see how to split each result into different variables. I have one RS232 master input device, and I'm looking for a way to "send" the result to a specific variable/display (e,g if my command counter is 1, send the result to the variable 1, counter =2, send result to variable 2...).

 

I've searched for a de-multiplexing module, but I didn't manage to find a solution.

 

Is there a simple way to achieve that ?

 

Thanks in advance !

 

 

0 Kudos
Message 1 of 9
(3,828 Views)

The Signal Router module (Control Group) might be able to handle it. 

With a control input, you can specify which output to use, and then use a Write Variable to store it for use elsewhere. 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 9
(3,806 Views)

It looks like that this module may solve my problem, but the result is strange... Attached is my worksheet.

 

On the X input I have the ramp generator (a continuous move from 0 to 6)

On the 0 input I have the incoming serial data.

 

I use the "edge controlled increment", but when running it does write on the first text block, then multiple times on the second one...

 

(I had to add a "signal adaptation module" between my ramp generator and the mux module to solve a timing problem.)

 

I am doing something wrong ?

 

Thanks !

 

 

0 Kudos
Message 3 of 9
(3,780 Views)

 

You don't want edge controlled... you want the input channel on the X input to specify the output channel to use. Note that I also changed the worksheet, to avoid using the alignment module to upsample the data to 11kHz. 

 

Try the attached. 

 

Snag_1a29e42.png

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 4 of 9
(3,762 Views)

Many thanks !

 

Let me try to fully understand...

 

The "edge" mode will increase/decrease the channel output each time that the input detect a rising edge, so I need to provide a clock or rectangle signal

 

The "Control channel" actually select the output regarding the current input value ? (If my input is >=1 and <2 it will be channel 1)

 

Is this correct ?

 

 

0 Kudos
Message 5 of 9
(3,759 Views)

Yes. Your timer was outputting a triangle wave, so there is only one "edge" detected for each cycle. 

 

If you want to use this triangle technique, then the value = channel is the correct setting. 

 

If you use a TTL Pulse Generator to set up a timing signal, then you would use the Edge increment setting. Each rising edge of the timer would change channels. But, then you would need a counter to keep track of where you were in the count. 

 

The complication of the setup is that the input value will repeat one or more times for each channel, depending on the timing/sample rate. 

 

what does the input stream look like? Can't you do the 18 channels individually? Send the data request command for each channel, interpret it, and then send the next one? 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 6 of 9
(3,753 Views)

Many thanks !

 

"what does the input stream look like?"

 

I have a command for each channel :

 

Channel 1 : $0A05035D\r

Channel 2 : $0A05045E\r

...

Channel 16 : $0A050E6F\r

 

So my issue was to send the result of each command in different channels. It works like this, but as you have noticed, I can have issues. (and the speed is limited....)

 

"Can't you do the 18 channels individually? Send the data request command for each channel, interpret it, and then send the next one?"

 

Is there a simple way to achieve that ?

0 Kudos
Message 7 of 9
(3,747 Views)
Solution
Accepted by topic author Yoruk

See the attached. I set up 18 channels, but you didn't have all of the data request commands defined in your worksheet. 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 8 of 9
(3,743 Views)

MANY thanks for taking time to study my request. This sample looks just perfect !!

 

So here the system actually sends the first channel command, waits and interpret the answer, then ask the second one ?

0 Kudos
Message 9 of 9
(3,741 Views)