Jump to content

Problem! how could the Bricks know that Labview collapsed and take action to switch the bricklets off?


Recommended Posts

Hello , 

i'm trying to run "Heating system Project" using Tinkerforge system (using Master Bricks3.0 , Solid State Relay Bricklet connencted to the heaters with SS-RELAY) programmed throw Labview.

The LabView Programming and simulation working perfect! the Problem is if the System is running  and heater are ON and Labview collapsed the Heater keep the Signal On as it was the last signal came from  Labview and the only way to get it off again is to run the labview then bring system to safe state or throw Brick viewer application. 

Now as i want to run the system stable and safe want to find a way that makes the Master Bricks not to send/keep any Signals as soon as Labview collapsed or any other propability could happen. 

IHow could i solve this issue? is there anything that i could do with Labview or Hardware solution from Tinkerforge could help this issue.

 

Thanks  

Ahmed

Link to comment
Share on other sites

I assume you use the SetState function of the Solid State Relay Bricklet 2.0. I assume you call SetState(true) once to turn the heater on and SetState(false) once to turn it off.

To avoid that the heater stays on if your LabVIEW program stops working you can use the SetMonoflop function instead. If you call SetMonoflop(true, 5000) then the Solid State Relay Bricklet 2.0 will switch on for 5000 milliseconds and then switch itself off again.

So instead of calling SetState(true) once to turn the heater on you call SetMonoflop(true, 5000) every second instead. This results in constantly extending the time the relay stays on, essentially keeping it on constantly as long as you keep calling SetMonoflop(true, 5000) again before the 5000 milliseconds expire. To turn off the relay you just call SetState(false) once. This turns the relay off and aborts any pending monoflop.

This way the relay will turn itself off 5000 milliseconds after your LabVIEW program stopped working, bringing you system to a safe state.

Link to comment
Share on other sites

 Exactly I used SetState instead SetMonoflop. Now I change it and it works perfectly Tanks a Alot!


I wanna ask another question please! regarding uid for each bricklet. Should I put it manually by each time I open the labview? or there is a way to keep uid saved in labview.

thanks a lot 

Link to comment
Share on other sites

I assume you're using a control to represent the UID, just the same as our examples do. A control will not keep changes that you make to its value by default. You have to tell the control to use the current value as its default value. To do this change the control to the UID you want, then open the context menu of that control and select "Data Operations" followed by "Make Current Value Default". Now save the file. The next time you open it the control will contain the changed UID.

You can also replace the control with a constant to archive the same result. The difference is that the constant will not show up on the front panel.

Link to comment
Share on other sites

Regarding the problem of the Solid State Relay, I figured out now another issue. 

I used  as u mentioned before "SetMonoflop(true, 5000) " and if LabVIEW program stopped working then after 5 second the Relay also will stop working. 

Now the problem is if the LabVIEW running and Heater is ON and i closed LabView the Heater goes OFF for a while then goes On itself again.

 

Link to comment
Share on other sites

I assume you use SetMonoflop(false, 5000) to turn off the heater. This will turn of the heater for 5 seconds then turn it back on again. This is bad. You need to use SetState(false) to turn off the heater and keep it off.

Link to comment
Share on other sites

I used SetState(false) before but it didn't bring the system in a safe state in case of Labview collapsed.

Now!  I'm using SetMonoflop( boolean switch ON/OFF , 5000) to switch the heater on and off and also to bring the system to a safe state in case Labview Collapsed.

If i switched off the heater using the boolean Switch, then the heater will be Off as it has to be,  then by stopping the execution of Labview or closing the Program completely the Heater Turn on again. 

 

Link to comment
Share on other sites

Your problem is that you use SetMonoflop now for turning the heater on AND off.

You need to call SetMonoflop(true, 5000) repeatedly to turn the header on and keep it on

You need to call SetState(false) once to turn the heater off.

Link to comment
Share on other sites

Okay, I see your problem now. You have to use SetMonoflop(true, 5000) OR SetState(false). But you're using both in sequence. This doesn't do the correct thing. You need to use a case structure in your while loop. In the true case it contains SetMonoflop(true, 5000) in the false case it contains SetState(false).

I created a new LabVIEW example to demonstrate this:

https://www.tinkerforge.com/en/doc/Software/Bricklets/SolidStateRelayV2_Bricklet_LabVIEW.html#monoflop

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...