10-17-2024 09:37 AM
Dear members, this is my 1st Labview code.
What I have : Labview 2018 + USB-6361 BNC card
What I need : (to monitor an electrolytic process that last for about 1 hour)
a- record multiple analog input channels
- for a time window of about ~0.5ms
- every ~5 minutes
- for about 45 minutes
b- (desired/not needed) show the results "live" during the whole 45minutes and the last recorded "event"
So the code I have gets this done... but :
- the waveform chart is not readable... the time elapsed between acquisitions is too big so my events only show as a line... still, solving this is desired but not mandatory.
- if I put the STOP DAQ TASK outside the while loop, the trigger only works once, so my acquisitions start in a random moment. If I put the END TASK inside the while loop I get a very heavy code taking a lot of time to complete one iteration (with virtual signals works fine, but not with the real card and a signal generator).
- I apologize, the code is in french
- I need to record at ~100kHz / 0.5ms --> about 50 samples
So, the lower half of the code seems to work I even disabled it for testing, but it changes nothing.
Solved! Go to Solution.
10-17-2024 10:46 AM
We can't really analyze "pictures" of code, so please attach your VI.
What I can tell immediately is that you have glaring race conditions due to blatant overuse of local variables. You cannot tell in which order the terminal is written or the locals are read, but the result depends on correct order. LabVIEW does not execute left to right and execution order is purely determined by dataflow. There is no way to determine execution order of all your disconnected code islands.
10-17-2024 03:52 PM
10-18-2024 12:24 AM
Hi, I don't seem to have project templates
And from help>>search for examples >> I got a few hints that led me to my actual code, but none of the ones I saw actually used a continuos acquisition with analog trigger
10-18-2024 01:22 AM
Hi,
I got rid of most of the local variables... There is still one to modify a control... a shift register would not be useful for this, would it?
I thought I was making the vi "more readable" by using local variables (I guess that should be a common excuse to justify bad coding practices among us, newbies)
The "new" vi is attached
10-18-2024 09:42 AM - edited 10-18-2024 09:43 AM
@GeorgeMartin wrote:
Hi, I don't seem to have project templates
And from help>>search for examples >> I got a few hints that led me to my actual code, but none of the ones I saw actually used a continuos acquisition with analog trigger
Those are VI Templates! You want the Project Templates. Possible easier to get to from the Getting Started Window. There is a menu option to show the GSW too! ???View>>GSW??? I think.
10-21-2024 04:58 AM
So "I got it"...
but I cannot run it
but from what I could see, this code (that is clearly beyond my current skills) doesn't seem to be triggering
11-01-2024 03:48 AM
anyone with an idea?
11-01-2024 04:16 AM
Hi George,
@GeorgeMartin wrote:
anyone with an idea?
Activate the missing "professional" license as indicated by that error message…
11-01-2024 04:29 AM
I doubt that my company will accept to buy a different licence from the one we already paid, in order to get running an example that might not help at all with the problem that I have.
But thank you for your answer.