From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automation in labview

I'm pretty new to Labview and here is our project that I'm hoping to write labview code for:

We are using SCI-FIT Pro2 in a research setting. We are planning to do a research project in which we need to program the sci-fit to fit our custom resistance pattern that would change over short time intervals. Our outcome measure, or performance measure, is RPM. We will tell the subject that their goal is maintain a certain RPM (e.g. 40 revolutions per minute), and that’s all they know. Behind the scenes, we want to be able to apply a resistance pattern and there should be flexibility so that we can program any resistance pattern we want. For example, one resistance pattern could be something like this:

 

1 kg —> 5 kg —> 7 kg —> 2 kg —> 10 kg —> 4 kg, etc. and keep repeating this pattern during a trial, with each interval (—>) lasting 1 minute.

 

we have 4 output wires going from the console unit of our exercise machine which control the UP and DOWN buttons of the console unit and we are planning to connect them to NI-9485 . When 2 out the 4 wires touch, the resistance goes either UP or DOWN depending on which wires are being connected.

 

So Here are my questions: 

1- Is there a way we can set a clock to read certain pins every T second( lets say if we want up , makes red & black wire press together? so resistance go up)

2- is there a way you can record the pattern in labview ( see the attached pic)

3- Is there a way to repeat the pattern in labview

TIA

0 Kudos
Message 1 of 11
(4,254 Views)

Yes, it's possible to do all of this, but, unsurprisingly, you'll have to program it (LabVIEW is, after all, a programming language). If you're asking how to do it, that would require much more detailed information from you, and would basically be someone writing your project for you. If you're not sure where to start, try breaking your project into smaller pieces and writing code to do just one of them, then build on that. If you need help learning LabVIEW, there are lots of tutorials available on the NI website and examples that ship with LabVIEW. Of course, please post more details here if you have a more specific question once you start coding.

Message 2 of 11
(4,232 Views)

thank you very much. yes, basically where to start. I used labview during my undergrad studies but I only used for homework ( not real projects). Is there a tutorial online for automation?

0 Kudos
Message 3 of 11
(4,227 Views)

Look at the links when you first open the LabVIEW forums, and those will give you a good start. If your employer has an SSP, that will give really good content as well. Going through Core 1, 2 and 3 will set you up to do a lot in LabVIEW. (You actually have to do the exercises though 🙂 )

 

Capture.PNG

 

 

Message 4 of 11
(4,210 Views)

@Canucks.canucks wrote:

Is there a tutorial online for automation?


There are examples for nearly every piece of NI hardware, so you might want to look at the ones for the hardware you'll be using. There's nothing specific to the very general term "automation" though - a lot of what we do with computers is automating tasks.

 

There is unlikely to be a template that does exactly, or even approximately, what you want to do. This might be a "big" project relative to your experience and could take you a few weeks, probably longer than any homework assignment you had, but that's how work goes. Start small, gain confidence in coding each individual part of the system (closing and re-opening the relay contacts, making a timer, writing data to a file, etc) and then put them together. A lot of this can be done without any actual hardware, for example turn on a boolean indicator on the front panel instead of switching the relay, so you can see what's happening without a connection to the machine.

Message 5 of 11
(4,205 Views)

The only piece of hardware you mentioned was a NI-9485.

 

That's a module that only has outputs (well, relays that it activates), not inputs.  Do you have any way of getting feedback from your device?  Right now it sound like you just want to replace manual buttons with relays.  Doing this might work but there's potential for timing issues and missed activations that you couldn't check for and compensate for.

 

Additionally, it does need to plug into something else between it and the PC.  So... what are you plugging it into?  A CompactDAQ or CompactRIO?  

Message 6 of 11
(4,190 Views)

shoot accidentally hit accept as soln 

we are also using CDAq-9171. yes basically instead of manually pushing we want it to be automated , every T sec button be pushed

0 Kudos
Message 7 of 11
(4,184 Views)

WARNING: Humor Ahead- Canadians need not laugh-

 

To put it bluntly "dontchano- ya U's da computer thingy todo da stuff automaticallike"

 

So you have a single cDAQ chassis and well,  What would you like to interface with?  That little bit of information could help us help you.

 

But, thank you for letting me express a lack of accent (We midwsternr's don't have no accent A?) Funny EH?


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(4,159 Views)

LOL That was actually pretty funny ! I though you are gonna talk "aboot" molson, Tim Horton or hockey, eh?

We are hoping the interface would be on labview on our laptop since we doesn't have scifit console circuit diagram and we can't program it 

0 Kudos
Message 9 of 11
(4,096 Views)

So as I understand it this thing is some kind of exercise bike with a few buttons on the front panel that you want to have the relays press for you?

 

Well, assuming you can open up the control panel and find the electrical contacts that lead to the buttons, and assuming that the buttons are simple open/close circuits, then yes, you can do what you want to do.

 

However, from what I can tell you have zero feedback capability from this.  The pictures of the bike make it look like it has some kind of interactive menu system.  As such, it's going to be tricky to pull this off since the menu could be at any state other than the one you hope it will be in and you'll have no way of checking this automatically.  I know that often these kinds of menu systems aren't super reliable and seem to miss button presses sometimes and take variable amounts of time to respond to the button presses that they do register.

 

As for how to do it, try this:

1. Write instructions, in plain English, that you would give to a blind and deaf person who needed to push these buttons to accomplish your desired task.

2. Take these instructions and attempt to implement them in LabVIEW.  Make sure to build your program one step at a time so you can easily tell when something doesn't work.

3. If something doesn't work and you can't figure out why, do some basic troubleshooting and googling.

4. If that is unhelpful, come back here and post the code that isn't working and we can help you with that.

0 Kudos
Message 10 of 11
(4,087 Views)