01-05-2011 08:58 AM
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.
01-05-2011 09:38 AM
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
01-05-2011 10:30 AM
I guess the easy way is to drop the Switch into an array control on the front panel.
Alan
01-05-2011 10:46 AM
thanks for your idea, i think it'll work. i'll check this method and let you know sir
01-05-2011 11:30 AM
@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? The easy way is to simply use a Build Array on the block diagram.
01-05-2011 02:51 PM
smercurio_fc,
Firstly let me say I have a tremendous amount of respect for your LabVIEW skills and me being a fairly newly minted CLAD am in awe of your greatness. (seriously). But I found it easier to drop the switch into an array container, I had a USB-6008 connected to my laptop and a meter near by, built the VI quickly and tested it. I did say " I guess the easy way" I am sure your method is the CORRECT way and the best way. I did test my way and it did work.
Let me ask you a related question and something the OP might want to try. Suppose you wanted to add another switch and relay to the next DI/O port? I just did that and all I needed to do was pull the array container down "one" on the front panel, and another switch was added to the array. On the block diagram the express DAQ Assist automagicly adapted, no build array was used. This seemed pretty easy, But is this poor programming?
(FORGOT to mention I added the second I/O line to the express DAQ assist)
Thanks!
Alan
01-06-2011 03:17 AM
hello sir, really thanks for your great idea. Finally, It worked for me.... 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).
01-06-2011 03:23 AM
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?
01-06-2011 03:36 AM
hello sir, thanks for your great support. 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 one
01-06-2011 09:33 AM
@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.