LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Time Demultiplexing Analog Input with CompactRio

So I'm using a CompactRio to interface various sensors with LabView, some Digital Ins, some CANbus and some Analog Inputs.

 

One of the Analog sensors time multiplexes it's current output, so that each parameter is output for a second each in a given sequence, I've attached snapshots from the datasheet to show this.

I need then to demultiplex this signal in LabView to create an array that populates with the data.

 

I've looked through the forums and examples but can't find anything that does exactly this job.

 

Any help is appreciated. Thanks in advance

Download All
0 Kudos
Message 1 of 8
(1,254 Views)

Hi FuelActive,

 

you need to implement the sequence scheme as is explained in your "scheme" image!

Wait for an input current signal of <5mA, then read the signal until current >20mA.

Split the recorded current signal into chunks of 1s and convert each value according to its scaling parameters. Keep in mind timing inaccuracies: I would only use the range 0.2-0.8s from each chunks of 0.0-1.0s to derive the signal value from…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(1,247 Views)

Hi GerdW,

 

Thanks for your reply, unfortunately the actual coding is where I fall down, I'm new to labview and wouldn't know how to implement whats needed.

 

Best Regards,

Tom

0 Kudos
Message 3 of 8
(1,243 Views)

Hi Tom,

 


@FuelActiveTH wrote:

unfortunately the actual coding is where I fall down, I'm new to labview and wouldn't know how to implement whats needed.


Then your first step should be to go through all those "Training resources" as offered in the header of the LabVIEW board!

(Starting with a cRIO project is provide a steep learning curve…)

 

On the other hand you could write down all your requirements and offer a job in the "Job openings" board.

 

You need to learn a lot:

  1. first start with LabVIEW basics
  2. then (after practicing them) you need to learn cRIO/Realtime basics
  3. then after practicing them too you need to implement your algorithm in a realtime VI for your cRIO…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(1,237 Views)

Sorry maybe new to LabView wasn't the right phrase, I've done the basic course, and have created the code we've needed so far that allows us to read and store analog, digital and CANbus data. But am nowhere near an expert. I've written a very basic way of demultiplexing the data needed and it works okay, but it's very primitive and there must be a much better way to do it, I've attached a screenshot of what I've done.

0 Kudos
Message 5 of 8
(1,232 Views)

Hi FuelActive,

 


@FuelActiveTH wrote:

I've written a very basic way of demultiplexing the data needed and it works okay, but it's very primitive and there must be a much better way to do it, I've attached a screenshot of what I've done.


When it works as expected (aka "according to your requirements") then it is okay!

 

You may improve it, like:

- avoiding coercion dots by using the correct datatype (at those comparisons)

- use a feedback node to store the "frame start time" internally

- simplify the scaling: y=((x*1000-6)*2=x*2000-12=(x-0.006)*1000

- cleanup the code according to StyleGuide

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(1,211 Views)

Hi GerdW,

 

Thanks for your help! I've implemented the changes you suggested,

would a feedback node work on the array as well? Or not because it needs to be initialised with a dimension?

 

I'm trying to have as little inputs and output to the SubVI as possible

 

Thanks,

Tom

0 Kudos
Message 7 of 8
(1,157 Views)

Hi FuelActive,

 


@FuelActiveTH wrote:

would a feedback node work on the array as well?


Yes.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(1,154 Views)