Nice to meet you guys.
Im newbie at labview.
I tried to make a DC motor controller by using NI 9485.
Here is my code
when 'true' in boolean.
I aim, if i turn on boolean switch, that NI 9485 will generate the current to line 0.
If turn off, current go line1.
So i want to check it possible or not when i start that code.
Please give me some tips.
Solved! Go to Solution.
A few questions first:
This VI as it is probably doesn't do what you want.
You should take a look at the State Machine architecture, and particularly consider how you want the "logic" of your program to be. For example:
You could probably also get some use from an Event Structure if desired, but a polling state machine is a good first step and may do everything you need without adding complexity.
Thank you for apply.
1. I will provide constant power from 24V SMPS to NI 9485. So, both line having constant power from it.
2. Yes, you are right. That is why i choose NI 9485. I heard that it has relay function.
During provide one power to line 0, line 1 should be disconnected by relay in 9485
3. I want to run this VI for a moment(about 7 second), then stop about 10second by clicking "Stop button", and i will start again just after change direction.
This is my plan
1) Turn on boolean, then click start button.
2) Click stop button, then turn off boolean for change motor direction by closing line 0 and opening line 1.
3) Click start button
4) Click stop button, then turn on boolean for change motor direction.
5) Click start button,
repeat that step.
I hope this explanation will be helpful to fix my problems.
Thank you for the clarifications.
Regarding your reply:
2 - Indeed, the 9485 is a relay module. It contains 8 separate switches (of which it seems you want to use the first two). However, any combination can be opened or closed at once - closing #1 does not automatically open #0, or vice-versa.
Based on your description of the workflow, I'd like to suggest the following:
If you wanted to wait a specific time, rather than having a stop button, you could use either a Wait function or a Stall Data Flow.vim node (available from LabVIEW 2017 onwards).
If you wanted to stop at a specific time (e.g. 10 seconds) but still have a button to stop earlier, you could add a "Greater Than" node and wire the "i" terminal in this loop, and set an appropriate check based on the wait time (e.g. with the current values, 10s/50ms -> 2000 iterations, so use the "Or" node and greater than 1998 (or equals 1999)).