0
Answered

Switch reset on power up

Neeraj Chirmulay 6 years ago in IQANdesign updated by Ulrik Zakariasson (Software development) 6 years ago 12

Hello,

Is there any way to implement an on-screen switch (on/off) on an MD4, that always resets to Off upon power cycle or power up? We're trying to implement an on/off switch for a pump, but we don't want the switch to stay in its last state when the controller is powered off and powered on again. We would like it to always power up with that pump switch off. 

GOOD, I'M SATISFIED
Satisfaction mark by Neeraj Chirmulay 6 years ago

Is this a physical switch connected to a digital input or a virtual switch on the LCD screen?

A virtual switch (or button) on the screen

(Edit: For some reason it seems that my original reply did not get posted, this is my 2nd attempt to re-reply to this thread and will delete this post if the original reply appears, but my attachment does not seem to appear)


Just a question, are you controlling the pump via the output on the MD4 display only or do you have an additional I/O module connected?


If you are using the MD4 only (or with an expansion module) I would suggest using a "Virtual Button" in this case. Just make sure that you keep the "Store Value" on "No", you can also set the "Toggle" to "YES" to use the button for on and off.

  



Otherwise if you use a "Digital Parameter" the controller will be able to reboot and and on start up it will immediately recall the state it was in prior to the reboot. So if the pump was not switched OFF before powering down, then the pump will start running immediately when powering on the system.


I have (attempted to) attached a file that contains both a "digital parameter" and "virtual button" for you to see how both configurations work.







Thanks so much for the detailed explanation.
The MD4 doesn't directly switch the pump on or off. The on-screen button/ switch will change CAN messages being sent out to a motor controller to ask it to run or not run the pump. Using the "Virtual Button", will the "Output control" channel return to default/ zero upon restarting the MD4? 

Unfortunately I don't see any attachments, but it looks simple enough to replicate.

Won't it be possible to just to set a "time out" on the controlling CAN message? I'm just wondering... 


Are you running an IQAN Multi Master system or is this a different type of controller on the Network controlling the pump? 

I'm not sure I understand - the CAN message controls motor speed (driving the pump) and is sent by the MD4 to a motor controller. I believe timeouts apply to received messages to throw an error if I message isn't received for a set duration. 


I think we have a good solution now - check the comments below. We'll test it on the machine soon to verify. 


Thanks!

+1

Hi, you can do it similiar like here:

https://forum.iqan.se/communities/1/topics/1151-help-changing-the-state-of-a-digital-parameter-channel-from-inside-a-math-function

For the resetting function you could read a positive flank of an internal digital channel which gets true after a few ms after system start.

Hi Arno,
Could you elaborate on "read a positive flank of an internal digital channel..."?

+1

See the file, you can set the delay on to 0ms, 2000 just here for the simulation to see how it works.
The Mem channel has to be in an adjust-group and is controlled via display switch.
DP and MEM.idsx

Thanks Arno. This works!
It looks like the solutions library example but - perhaps because of Qcode and using "PositiveFlank" - does exactly what I need it to do. The MEM channel is now controlled via display switch, and also used in other places in the logic (in an FSM) to decide whether the pump should be running or not. 

+1

Guys,

There's a trick here. It is the "Delay on" in Arno's post above. Through iterations I observed that if that delay value is smaller than the cycle time for the controller, it does not reset. For delay >= cycle time, it works fine!

My suspicion is, the solutions library example will also work with an on-screen switch, so long as the delay is set to be >= cycle time.