Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Relay and window motor (http://www.chiefdelphi.com/forums/showthread.php?t=112666)

d4v4 03-02-2013 07:40

Relay and window motor
 
First of all, hello everyone and thank you for reading this :)

So I am learning LabView on myself for FRC and I got stuck.

I need to make a window motor connected on relay ( Spike ) and then when button 4 is pressed it rotates forward for some time ( for example 1 sec after that he must stop ) and then when button 2 is pressed it goes reverse ( because I need to lift a ramp for discs 4 times and then take it down for new load ) .

Also when I try to open new relay ( relay 2 ) LabView does not enable me to do it ( wire does not connect to Relay open ) , but I really need to use like 3 or 4 relays for my future work with motors...

Mark McLeod 03-02-2013 11:51

Re: Relay and window motor
 
1 Attachment(s)
Here is a sample multi-button sequence that goes in Periodic Tasks.vi (NOT Teleop.vi, because of the delays).
The sequences for each button are independent although Button 1 goes first if both buttons are pressed simultaneously.

However, the possibility of the wrong button being pushed must be handled.
What happens if button 1 is pushed twice in a row?
You can add a check that only allows the proper button to be pushed. That's called a state machine.
That might also be handled by adding a limit switch at the bottom as feedback for when it's all the way down, and maybe another to prevent it from going too far up. A limit switch check would then simply replace the timer at the beginning of each of the sequences.

For Opening Relays, if you can get one Open successfully coded, then you can highlight all of it , then copy/paste to get the next one.
Then use the cursor to select a different Relay number.

d4v4 07-02-2013 06:12

Re: Relay and window motor
 
2 Attachment(s)
Quote:

Originally Posted by Mark McLeod (Post 1226929)
For Opening Relays, if you can get one Open successfully coded, then you can highlight all of it , then copy/paste to get the next one.
Then use the cursor to select a different Relay number.

I really appreciate your help and the way you develop my idea :D

But I constantly get broken wires when I try to make Forward/Reverse or change relays name as you can see on screenshots :/

Alan Anderson 07-02-2013 08:35

Re: Relay and window motor
 
Quote:

Originally Posted by d4v4 (Post 1229259)
But I constantly get broken wires when I try to make Forward/Reverse or change relays name as you can see on screenshots :/

Even the one with the unbroken wire is telling you something is wrong. That red dot on the function input says there's a mismatch between the type of value you're giving it and what it expects.

To fix them, delete the enum constant (the name in the blue rectangle with the various little triangles around it) and the broken wires. Then right-click on the terminal you want to connect it to and choose Create >> Constant from the menu. Now you can change the constant to whatever value is appropriate for the code.


All times are GMT -5. The time now is 12:07.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi