06-24-2021 12:05 PM
We are using a labview program to control some instruments that gather force data and counts from a single DAQmx board. Currently our 2 main data signals are fed to a single AITask and this is fed to this code that was written years ago by someone we no longer have contact with. Currently I've got friction force reading out correctly but for the life of my I can't get the counter to read the data signal from the machine. I've verified that we have a clean signal in test panels but the value coming out of the counter is constantly zero. I am not sure if something is going wrong with the internal counter on the DAQmx or if there is simply something wrong with our code. I am an extreme novice at this. I am just looking to get it working again so we can gather data. Any help at all on this would be appreciated. I will upload the specific part of the code we are working on.
06-24-2021 01:09 PM - edited 06-24-2021 01:14 PM
Hi Chris,
comments on your VI:
Why do you need a stacked sequence when you can use DATAFLOW to enforce execution order?
Why don't you cleanup the code?
I did:
Why do you start the DAQmx task AFTER you read from the task?
Did you examine any of all those DAQmx example VIs in LabVIEW's example finder?
Why is that DAQmx task named "AItask"? Do you use just AI channels?
Why do you try to employ a "counter" functionality on an AI task? Counters use digital inputs, usually named PFIx…
Why do you mix DBL and integer datatypes so often, resulting in coercion dots?
06-29-2021 12:01 PM
We have a single Task called AITask that manages multiple AI signals. How do we select which signal is applied in a certain area? I only see a way to select the task. We want the third signal from a specific analog input for this specific area of our code. I am not sure if I'm supposed to use a string somewhere to designate the channel we want to use but it is critical that all analog signals are on the same task for it to run properly. I am sure this is a simple question but I am just at a loss. I am not a labview user I just need to get some code that was already written running again. Once again I simply need to tell the code which signal I want it to use from a task in this specific location. Any help at all would be apprecated. (Dev2/ai9 is the signal of interest)
06-29-2021 12:46 PM
But your DAQmx Read is using a Counter read, not an AI read. If you were doing an AI read, then you can get a waveform for each channel in the task. Then you can just use Index Array to get the waveform you care about.
06-29-2021 02:05 PM
Before everyone rips into me about how disorganized or bad my code is, it was created by an engineer who I don't know many years ago to accomplish a task, which it apparently used to accomplish well. After updates and moving the equipment across country multiple times and updating code to latest lab view version it does not work anymore. I have done some work troubleshooting but I am in no way a Lab View expert. I am very bad. I just need it to work as it will not be messed with again for many years. In this portion of the code we are reading an analog signal that supposedly relates to RPM. I have all three analog signals we've tried so far on the same task, AITask. I have created an index array top get the appropriate signal for this part of the code. I am confident we are reading the signal. Now my math doesn't work out after the signal is read. The RPM reported is incorrect. If someone can look at it and try to understand why it is not giving me a correct number or can explain what the original coder's intent was here that would be great. I am simply trying to plot load, read using an AI signal, against counts from spinning of a shaft. Counts will be related to RPM. Help please. I just need this to work.
06-29-2021 03:15 PM
Hi Chris,
@ChrisCrouse wrote:
If someone can look at it
I just need this to work.
Well, if you would attach "it/this"...
06-29-2021 03:29 PM
I posted it before but something went wrong.
06-29-2021 04:19 PM
You are correct -- the code is simply awful! So let's forget about it, and ask some (possibly useful) questions:
Now, for the most important question of all -- doesn't anyone in your organization know LabVIEW? If the answer is "no", then why are you carrying around a (very bad) piece of LabVIEW code that seems to be important to the company?
I'll bet a good LabVIEW consultant would be very much worth her fee ...
Bob Schor
06-29-2021 04:30 PM - edited 06-29-2021 04:30 PM
@ChrisCrouse wrote:
I posted it before but something went wrong.
It is not useful to re-post basically the same VI over and over.
You can ask the moderator to merge all these thread, then sit down, real all the comments, and answer all question. 😄
07-08-2021 12:09 PM
It's also not useful to receive such backhanded snotty replies from so many people. I am not a lab view expert, which is why I came here for help. I shouldn't get criticized each time I post the code that I didn't even write when I am just trying to get it to work. Too much snobbery in this forum. Not everyone is an expert on lab view and not everyone wants to be, some of us just need to use it to get our real jobs done.