LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding timestamp to DAQMX data stream


I was wrong, disregard

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 21
(1,530 Views)

Ben,

I'm referring to the actual LabVIEW files/VI that the snippet comes from. When I drag the image into my VI, it shows up as an .PNG Image and I can't dig further into the code using LabVIEW to determine how each sub-vi is configured. 

 

 

0 Kudos
Message 12 of 21
(1,525 Views)

Yes, It looks like Bob posted a Snippet but it appears to be a png of a snippet.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 13 of 21
(1,519 Views)

It is a VI snippet.  But it shows a problem that was created when the forums were updated a year ago and they way it no longer handles images properly.  Here is what you need to do.

 

1.  Click on the image so it pops up the picture viewer.

2.  Click on the download icon to save the file.

3.  Open the browser's download directory and move the file to the desktop.

4.  Drag the image file from the desktop to the block diagram.

 

What used to be a 1 or 2 step process has turned into a much longer process when the forums were "updated".

 

(See this thread. https://forums.ni.com/t5/Feedback-on-NI-Community/Snippets-are-broken/m-p/3660525#M14813)

Message 14 of 21
(1,509 Views)

Bob, 

Thank you for the reply. Using some of the programming from your snippet, I was able to create arrays which contain the variables for my linear calibration equations. However, after testing the VI, I determined that the 4 linear equations defined by my arrays were not being transferred to the 4 voltage channels independently. From what I can tell, the VI is transferring a single calibration equation (I'm not sure which) to all four channels on my Create Channel sub-VI. 

 

Some details about my application and the testing I've done so far:
-The four voltages I'm concerned with come from 4 identical pressure transducers with very similar (linear) calibration equations.

-In the attached VI, you will see that I have changed the y-intercepts and slopes for the calibration equations so that one channel should output a dramatically different output than the other three. I did this to test that each channel was getting it's own calibration equation independent of the other channels. Once I confirmed that, I was going to input real calibration constants to the arrays so the data coming out of the VI corresponded to real values. Unfortunately, I can't discern a difference between the data on channel 2 and the data on the other 3 channels. This leads me to believe that I've made an error in programming that is preventing the 4 equations from being applied to the 4 channels.

 

Can you tell what I'm doing wrong? VI attached.

 

Thanks a lot,

Dom

 

0 Kudos
Message 15 of 21
(1,497 Views)

I'm wondering if the problem is that when you create the scale in each iteration, it is always called "Scale".  Perhaps the 3rd setting of it is what sticks and applies to all 3 since they are all assigned to scale "Scale".

 

What if you call the scale "ScaleX" where X is 0, 1, 2 and is formatted from the i value of the For Loop.

Message 16 of 21
(1,492 Views)

I updated the VI to mimic the programming that Bob provided in his initial snippet, where the name of the scaling function changes with every iteration of the for loop. However, I'm still only getting one of the calibration equations to come through. Any other ideas? Update VI attached.

0 Kudos
Message 17 of 21
(1,467 Views)

Look again at Bob's code and observe he uses a "Create Task" BEFORE the For loop and uses the shift register to add the channels to his tasks. I suspect you are loosing your task because you are NOT wired from the Shift Register INSIDE the For loop as you add channels to the task.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 18 of 21
(1,464 Views)

Also, the temperature and current tasks belong outside the For Loop because you don't want to create them 4 times.  And the Channels for the Voltage should be an array of individual channels that are auto-indexed.  Right now you are creating channel ai0 through ai3 on every iteration of the For Loop.  I don't know what happens when you add a channel to a task that has already been added to a task, but I can certainly see how scale #4 is getting applied to all 4 channels in the last iteration of the loop.

 

The attached VI should be closer to what you want.

Message 19 of 21
(1,461 Views)

After a few modifications, it looks like the equations are coming through properly now. Thanks a lot!

 

I would also like to add calibration equations to the thermocouple channels. However, if you configure the DAQmx "Create Virtual Channel" VI to accept thermocouple data, there is no place for me to add scaling information like I have with the voltage. Is there a way to add scaling functions to thermocouple data?

 

0 Kudos
Message 20 of 21
(1,453 Views)