LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter not working, need troubleshooting.

Was all the snark deleted?  Dang, I was hoping for some entertaining reading material...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 13
(787 Views)

A bit of advice for you: yes, people on this forum can be a little short-triggered about sloppy code. It's not ideal.

 

However, what's happening here is that you posted multiple questions in multiple threads, posting some bad code you unfortunately inherited. That sucks. I've been there before. Now, people are reviewing your code and it's unclear why anything is the way it is. Thus, people are asking- what is the intent of the code? What's going on here? All we know is "This code used to work now it doesn't". Not a lot to go on there, is it? So, we're going to ask you questions.

 

Maybe the questions are a little more terse than you'd like them to be, but don't get offended by it. You have to remember- you're sitting here asking professional LabVIEW developers to fix your code for free. You're getting paid to fix it, and you're asking us all for free help. Now that's why we're here- to offer help- but remember, almost anyone here who is a LabVIEW pro gets paid to fix VI's like this (or develop new ones) and the advice offered here is just to help others out.

 

With an attitude of "Don't give me any crap, just fix my code so I can do my real job" you're not going to get very much free help from professionals.

 

The code you inherited is really bad. I know that's not your fault, nobody is blaming you for that. I've seen and fixed worse code (paid, of course...). The problem is we can't just wave a magic wand and fix your code when it's literally so bad we can't even tell what it does. Not only that, but you haven't even told us what device it's interfacing with, so even if the code was good we'd STILL be confused as to what you're trying to do.

 

I think one of the above posters is correct- you likely need a LabVIEW consultant to come in and fix this whole thing up for you. You're probably looking at $2-$4k minimum to get someone up to speed on your system and fixing things up.

 

Now, to try to help a LITTLE bit... it SOUNDS like you have your AI task configured in MAX. Is that right? Is it an analog task or a counter one? Either way, you want DAQmx Read, configured for Multiple Channels. You have to read all of the channels- you can't read only one out of a task. Once you read all of the channels, use Index Array to select a specific one. Now honestly this is all a guess based on years of using DAQmx and trying to guess what you're trying to do.

0 Kudos
Message 12 of 13
(785 Views)

Okay I tried to be as clear as possible. We are just graphing the number of turns of a shaft versus friction load. There are two signals of interest and I just want to plot cycles on X and load on Y. It's an incredibly easy problem but I can't get the code that someone wrote over 20 years ago to work. We had to convert from a very old version. If it dumped the X-Y data to excel that would be fine. I am not sure why the code is so complicated. The load data already dumps to excel so we have been just fudging the counts to match as best as we could, but if we could just get these two AI signals to plot in X and Y we have what we want. I am just running into multiple issues with how to set up tasks, how to configure timing, how to actually convert an AI signal to a count, how to get the correct values, how to wire things, which data types don't mix, these are all problems that must be very simple to all of you but I will never have to encounter this again. I just need it to work so I can get data. So currently my VI I posted here is supposed to gather counts from an AI signal. The physical machine reads the counts with a small device that gets the same signal. I've gone through troubleshooting the load signal and have created a physical filter with a capacitor and resistor and I've solved a lot of problems up until now but I just can't understand how to turn an AI signal from an RPM/count device into an array of X values for plotting.

0 Kudos
Message 13 of 13
(781 Views)