09-16-2018 06:11 PM - edited 09-16-2018 06:36 PM
Thank you again.. (my apologies for too many edits.. I've bee spotting little things here and there)
09-16-2018 06:54 PM - edited 09-16-2018 06:56 PM
This does not look right, because an "over threshold" would get ignored while any of the other booleans are true. There needs to be a priority. In fact, if any two are true (one button and the overvoltage at the same time), you'll execute the empty default case.
09-16-2018 07:11 PM - edited 09-16-2018 07:31 PM
I pushed the voltage reading and comparison to threshold to the top (case 1). Is this what you mean by prioritizing the threshold comparison?
The mechanical action is set such that it latches when pressed. I don't think I can have more than one being true simultaneously.
I see your point. I turned on the "highlight execution" and held two of the buttons. (so two of the inputs are True). I noticed that the output of "Boolean Array To Number" was 192 and that led to triggering "default."
Although this wont ever happen in my experiment, I would like to know how you would prioritize the voltage reading compared to the threshold.
09-16-2018 08:19 PM
If the overthreshold is the highest bit, you could make its case 128 ...... which will give that case no matter which other buttons are pressed.
You might also consider using search 1-D array for the first true, and the index will be what drives the case structure.
09-17-2018 01:12 AM
You also still have 8 instances of the same string diagram constant ("GPIB0::11::INSTR"). Exactly one is sufficient, right?
Also, if stop is pressed, shouldn't you e.g. send a VISA command (e.g. "off" or similar)?
09-17-2018 01:59 AM - edited 09-17-2018 10:15 AM
OK, here's a quick draft how I would probably do it, reusing most code as much as possible. It even sends an off command when the stop button is pressed.
Note how I align the string array diagram constant with the button terminals to easily see what each one is sending.
(As noted earlier, I don't have DAQmx here, so I cannot test. It probably needs a few tweaks here or there. 😉
I also cannot wire errors, because I don't have the functions. You should wire all errors. Modify as needed)
Comparison with your code:
09-17-2018 03:45 PM
Thank you for your comment and vi file.
I made a few tweaks, most notably moving the 2nd "high resolution relative" inside the case structure.
(this was the only way I could think of to have the program trigger the time difference calculation when the threshold voltage was exceeded)
09-17-2018 06:54 PM
09-24-2018 07:55 AM - edited 09-24-2018 08:16 AM
(I apologize. I was able to fix this issue by following the instructions here.)
Hello, it's been a long time and I noticed one issue with the program that I cannot wrap my head around.
The voltage reading cannot exceed 5.26V I noticed even if the actual voltage is well above it. The voltage reading gets stuck at 5.26V.
Is this a limitation of sorts by LabVIEW?
I know it's not the settings of my NIDAQ because when I use igor to measure the analog input voltage, it can go above 5.26V
09-24-2018 08:31 AM
Well, Igor is probably used to therapeutic voltages:D for his EST. Or, could you clarify that?
Your channel is likely scaled to 5V max. Or, you damaged the DAQ front end