Ahmed Posted October 15, 2021 at 10:10 AM Share Posted October 15, 2021 at 10:10 AM 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 Quote Link to comment Share on other sites More sharing options...
photron Posted October 15, 2021 at 10:28 AM Share Posted October 15, 2021 at 10:28 AM 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. Quote Link to comment Share on other sites More sharing options...
Ahmed Posted October 15, 2021 at 10:59 AM Author Share Posted October 15, 2021 at 10:59 AM 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 Quote Link to comment Share on other sites More sharing options...
photron Posted October 15, 2021 at 11:40 AM Share Posted October 15, 2021 at 11:40 AM 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. Quote Link to comment Share on other sites More sharing options...
Ahmed Posted October 18, 2021 at 08:37 AM Author Share Posted October 18, 2021 at 08:37 AM 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. Quote Link to comment Share on other sites More sharing options...
photron Posted October 18, 2021 at 08:49 AM Share Posted October 18, 2021 at 08:49 AM 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. Quote Link to comment Share on other sites More sharing options...
Ahmed Posted October 18, 2021 at 09:08 AM Author Share Posted October 18, 2021 at 09:08 AM 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. Quote Link to comment Share on other sites More sharing options...
photron Posted October 18, 2021 at 09:14 AM Share Posted October 18, 2021 at 09:14 AM 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. Quote Link to comment Share on other sites More sharing options...
Ahmed Posted October 18, 2021 at 12:06 PM Author Share Posted October 18, 2021 at 12:06 PM I tried it, but unfortunately, it seems not working well. Would you mind if you have a look on the Code and see if i did something wrong? Heater.vi Quote Link to comment Share on other sites More sharing options...
photron Posted October 18, 2021 at 02:00 PM Share Posted October 18, 2021 at 02:00 PM 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.