LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RELAY CONTROL USING USB-6008

Solved!
Go to solution

Well, that VI will simply turn the relay on/off at the duty cycle of the square wave. Your comments indicated you wanted to be able to do this "on demand". This means you need a toggle switch on the front panel to control the relay's state.

0 Kudos
Message 11 of 20
(2,667 Views)

By inserting the boolean switch, i got an error message. The error message was like this

 

"you have connected a scalar(non-aray) data type to an array of the the same data type. This type conflict may be resolved by building the scalar type into an array. check for tunnel on a loop that has indexing incorrectly disabled.

 

the type of the source is boolean(TRUE OR FALSE)

the type of the sink is 1-D array of boolean(TRUE OR FALSE)"

 

 

So, i planned to introduce simulation. and the stop button would control the process.

 

sir, suggest me in removing this error please... i need the boolean control or anything which will make relay ON and OFF

0 Kudos
Message 12 of 20
(2,654 Views)

I guess the easy way  is to drop the Switch into an array control on the front panel.

 

Alan

 

 

0 Kudos
Message 13 of 20
(2,638 Views)

thanks for your idea, i think it'll work.  i'll check this method and let you know sir

0 Kudos
Message 14 of 20
(2,632 Views)
Solution
Accepted by BYm

@BYm wrote:

By inserting the boolean switch, i got an error message. The error message was like this

 

"you have connected a scalar(non-aray) data type to an array of the the same data type. This type conflict may be resolved by building the scalar type into an array. check for tunnel on a loop that has indexing incorrectly disabled.

 

the type of the source is boolean(TRUE OR FALSE)

the type of the sink is 1-D array of boolean(TRUE OR FALSE)"


The reason you are getting that error is that the DAQ Assistant uses dynamic data. You cannot convert a single Boolean to dynamic data. You need to feed in an array.

 

 


@ajmartin wrote:

I guess the easy way  is to drop the Switch into an array control on the front panel.


 

Actually, that's not the easy way to do it. Why would you put a single switch into a front panel array? Smiley Surprised  The easy way is to simply use a Build Array on the block diagram.

 

 

0 Kudos
Message 15 of 20
(2,625 Views)

 

 

(FORGOT to mention I added the second I/O line to the express DAQ assist)

 

 

0 Kudos
Message 16 of 20
(2,606 Views)

hello sir, really thanks for your great idea. Finally, It worked for meSmiley Happy.... as you said i chose the array control in that, i replaced control with a boolean one.

 

the other way in the front panel can also be done like this, BOOLEAN SWITCH > DDT(TO DYNAMIC DATA) > GENERATE DIGITAL SIGNALS(DAQ).

 

 

0 Kudos
Message 17 of 20
(2,569 Views)

sir one more question, how can i make this fully automatic which will make this relay ON ( say for 10sec), then again OFF. And this cycle has to be continued ON and OFF. what i mean to say is without using the BOOLEAN switch how can i automate this cycle?

0 Kudos
Message 18 of 20
(2,567 Views)

hello sir, thanks for your great supportSmiley Happy. Now the 1st stage problem got solved, i may use this multi relay idea what you said, in future. Great! well i think this is the easiest way to solve this program, i hope this is not POOR programming but its PURE oneSmiley Wink

0 Kudos
Message 19 of 20
(2,557 Views)

 


@BYm wrote:

sir one more question, how can i make this fully automatic which will make this relay ON ( say for 10sec), then again OFF. And this cycle has to be continued ON and OFF. what i mean to say is without using the BOOLEAN switch how can i automate this cycle?


You need to change it so that the Boolean triggers the initiation of the operation. Then you can just keep track of the time using a Tick Count or a Get Date/Time In Seconds or you can use the Elapsed Time Express VI. You can use shift registers to keep track of the current relay state. Attached is a simple VI to get you started.

 

0 Kudos
Message 20 of 20
(2,543 Views)