From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to receive more than one analog, digital and AK-protocol signals simultaneously via single VI?

I'm currently working on my bachelor thesis and it's about testing an internal combastion engine. I'm new to LabVIEW, it's been only 3 months since I started this project, so I'm having a lot of trouble. I'm using LabVIEW 2017 and the carrier SC-2345.

 

So, I need to receive 4 analog, 2 digital and 2 AK-protocol signals at the same time. I can receive the analog signals via daq assistant easily. I managed to receive AK-protocol signals via VISA although it fails sometimes. When I try to receive all signals simultaneously I couldn't get anywhere via daq assistant and when I searched about it in the forums it was mostly advised that I must use daqmx. When I tried daqmx I managed to get 2 analog, 1 digital and 1 AK signals at the same time, but things get more and more complicated beyond this point. I couldn't add any more outputs. After some more researching I found an example quite similar to my case which was done via daq assistant, however I couldn't manage to get it working in my case. If anyone has an idea to help me, it would be most appreciated. I'm sharing more information below about the signals in case anyone needs it.

 

4 Analog Signals: 1 thermocouple, 2 MAF sensors, 1 load cell (I'm getting these with analog input module)

2 Digital Signals: 1 encoder, 1 fuel flow meter (getting these with terminal block connection)

2 AK-protocol Signals: 1 AVL Digas 5000, 1 AVL 415S Smoke Meter (getting these with COM RS232 connection)

 

0 Kudos
Message 1 of 4
(2,382 Views)

Hi Thorun,

 

general suggestions on your generic question:

- use (atleast) 3 loops to handle your 3 different kind of signals

- when you have problems with your VI your should attach your VI…

Best regards,
GerdW


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

Thanks for your reply.

 

-I tried using 3 different loops, but then I got an error basically saying that I cannot receive all 3 signals at the same time. If I choose to continue anyway then I can only get 1 signal.

-I attached the VI.

0 Kudos
Message 3 of 4
(2,325 Views)

Hi Thorun,

 

there are several problems in your VI:

- you have configured a DAQmx task with 3 AI channels: you should NOT read this task at 3 different places in your DAQ loop. And especially you should NOT try to close that task 3 times!

- you should NOT initialize the encoder DAQmx task in the DAQ loop with each iteration!

- you should NOT use BytesAtPort, when you have configured to use the TermChar!

- you should NOT wire empty strings for channel/scale names!

 

- you should ALWAYS do some error handling in your VI!

- you should use AutoCleanup more often… (Ctrl-U)

- you DON'T need to wire all those default values…

 

I changed some parts of your VI, please run it and check for any error messages!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(2,323 Views)