02-15-2021 06:06 AM
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
02-15-2021 06:31 AM
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…
02-15-2021 06:36 AM
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
02-15-2021 06:43 AM - edited 02-15-2021 06:44 AM
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:
02-15-2021 06:52 AM - edited 02-15-2021 06:53 AM
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.
02-15-2021 07:21 AM
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
02-18-2021 04:36 AM
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
02-18-2021 05:47 AM