LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter not working, need troubleshooting.

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.

0 Kudos
Message 1 of 13
(2,840 Views)

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?

Best regards,
GerdW


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

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)

0 Kudos
Message 3 of 13
(2,779 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 13
(2,758 Views)

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. 

0 Kudos
Message 5 of 13
(2,802 Views)

Hi Chris,

 


@ChrisCrouse wrote:

 If someone can look at it

 I just need this to work. 


Well, if you would attach "it/this"...

Best regards,
GerdW


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

I posted it before but something went wrong.

0 Kudos
Message 7 of 13
(2,755 Views)

You are correct -- the code is simply awful!  So let's forget about it, and ask some (possibly useful) questions:

  • Please describe what you are doing (or what you think you are doing).  You seem to be taking a single Analog reading using a "Task" called AITask.
  • What is AITask?  Do you know what channels are being recorded?  Do you know what the sampling rate is?  Do you know if the Sampling is "Continuous", "Single Sample", "N Samples"?  [I might not have exactly the correct names here, but you should get the general idea].  Do the Channels have assigned names?
  • From what are you sampling?  Is it a tachometer?  Do you have any scale information (such as 1 v = 1000 RPM)?
  • What do you want to do with the data?  Are you content with a single sample?  Do you want to collect, say, "100 samples at 100 Hz" (or some other description)?
  • What do you want to do with the samples once you have them?

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

0 Kudos
Message 8 of 13
(2,744 Views)

@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. 😄

0 Kudos
Message 9 of 13
(2,739 Views)

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.

0 Kudos
Message 10 of 13
(2,257 Views)