Signal for safety control watchdog
27 Mar 2017 13:13 #90363
by Chre9
Signal for safety control watchdog was created by Chre9
Hey guys,
I am currently setting up a safety control for a milling machine, using PNOZmulti. This includes a watchdog function,
so I need a cyclical signal from linuxcnc, that I can send to the device via modbus/tcp (every 100ms/200ms/...) using MB2HAL.
Are values written every cycle so I can just set a modbus pin to 1 in my hal file?
Or are they only written if they change, so I have to use a pulse or something?
Thanks in advance
Christian
I am currently setting up a safety control for a milling machine, using PNOZmulti. This includes a watchdog function,
so I need a cyclical signal from linuxcnc, that I can send to the device via modbus/tcp (every 100ms/200ms/...) using MB2HAL.
Are values written every cycle so I can just set a modbus pin to 1 in my hal file?
Or are they only written if they change, so I have to use a pulse or something?
Thanks in advance
Christian
Please Log in or Create an account to join the conversation.
27 Mar 2017 14:22 #90370
by andypugh
Replied by andypugh on topic Signal for safety control watchdog
MB2HAL is a userspace component, so there is actually no guarantee that it will run at any particular frequency.
Is there any other way to keep the watchdog from biting?
Is there any other way to keep the watchdog from biting?
Please Log in or Create an account to join the conversation.
27 Mar 2017 15:24 #90377
by Chre9
Replied by Chre9 on topic Signal for safety control watchdog
I could set the watchdog timeout to a high value, like 1-10 seconds, but I don't see any other way use it.
Would you recommend using classicladder instead of mb2hal?
Would you recommend using classicladder instead of mb2hal?
Please Log in or Create an account to join the conversation.
27 Mar 2017 17:08 #90381
by andypugh
Replied by andypugh on topic Signal for safety control watchdog
Hopefully someone else will chime in, I have never actually used either.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
27 Mar 2017 17:28 #90384
by Todd Zuercher
Replied by Todd Zuercher on topic Signal for safety control watchdog
I am pretty sure that the values are written every cycle in mb2hal. (the cycle period is configured in the mb2hal.ini file) Timing is impreciseness because it isn't real time, but should be good enough for a few second watchdog.
In the config where I'm using mb2hal, I ended up disabling the watchdog in the VFD(s) because I was having too much trouble with inconstant results, because of read/write errors. I was never able to fix my communication error problem, and eventually lost interest and gave up (as it was/is working "good enough").
In the config where I'm using mb2hal, I ended up disabling the watchdog in the VFD(s) because I was having too much trouble with inconstant results, because of read/write errors. I was never able to fix my communication error problem, and eventually lost interest and gave up (as it was/is working "good enough").
Please Log in or Create an account to join the conversation.
28 Mar 2017 14:59 #90443
by Chre9
Replied by Chre9 on topic Signal for safety control watchdog
Ok, I think I'm going to use it like this for now.
I just started to set up mb2hal and came up with some problems. I hope you can also help me with this
As explained on linuxcnc.org/docs/html/drivers/mb2hal.html I put the line
'loadusr -w mb2hal config=MB2HAL.ini"
in my hal file and created a second ini file, called MB2HAL.ini, which is attached to this post.
The last transaction is supposed to transmit the pin for my watchdog.
So there should be some hal pins generated by mb2hal, right?
When I add show pin into the hal und open linuxcnc in the terminal, there aren't any additional pins shown.
These would be called mb2hal.15.00 for the watchdog for example if I got that right.
I just started to set up mb2hal and came up with some problems. I hope you can also help me with this
As explained on linuxcnc.org/docs/html/drivers/mb2hal.html I put the line
'loadusr -w mb2hal config=MB2HAL.ini"
in my hal file and created a second ini file, called MB2HAL.ini, which is attached to this post.
The last transaction is supposed to transmit the pin for my watchdog.
So there should be some hal pins generated by mb2hal, right?
When I add show pin into the hal und open linuxcnc in the terminal, there aren't any additional pins shown.
These would be called mb2hal.15.00 for the watchdog for example if I got that right.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
28 Mar 2017 17:25 #90453
by Todd Zuercher
Replied by Todd Zuercher on topic Signal for safety control watchdog
Yes, there should be mb2hal pins.
Can you see any mb2hal pins with Halshow while Linuxcnc is running?
Are there any clues in the debugging info when you start Linuxcnc from the terminal? Maybe you should try turning on the debugging in mb2hal?
Can you see any mb2hal pins with Halshow while Linuxcnc is running?
Are there any clues in the debugging info when you start Linuxcnc from the terminal? Maybe you should try turning on the debugging in mb2hal?
Please Log in or Create an account to join the conversation.
29 Mar 2017 11:26 #90494
by Chre9
Replied by Chre9 on topic Signal for safety control watchdog
I put DEBUG = 3 in all transactions, still no pins in terminal or halshow.
When starting from the terminal I can see some lines concerning the debuggingfor a short time, but after the starting there is only the pin list to see. Also no error messages..
When starting from the terminal I can see some lines concerning the debuggingfor a short time, but after the starting there is only the pin list to see. Also no error messages..
Please Log in or Create an account to join the conversation.
29 Mar 2017 14:30 #90505
by Chre9
Replied by Chre9 on topic Signal for safety control watchdog
I found a mistake: the loadusr function included "-w" instead of "-W".
If I start LinuxCNC now I get the following Debug file information:
mb2hal parse_transaction_section ERR: [TRANSACTION_00] [MB_TX_CODE] [fctn_02_read_discrete_inputs] out of range
mb2hal parse_ini_file ERR: parse_transaction_section 0 failed
mb2hal main ERR: Unable to parse INI file [MB2HAL.ini]
./Heller_CNC_XY.hal:19: mb2hal exited without becoming ready
13594
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components
So there seems to be a problem with the range of values, right?
The input values of the PNOZmulti device are 0...127and output are 8192...8319.
Any ideas?
If I start LinuxCNC now I get the following Debug file information:
mb2hal parse_transaction_section ERR: [TRANSACTION_00] [MB_TX_CODE] [fctn_02_read_discrete_inputs] out of range
mb2hal parse_ini_file ERR: parse_transaction_section 0 failed
mb2hal main ERR: Unable to parse INI file [MB2HAL.ini]
./Heller_CNC_XY.hal:19: mb2hal exited without becoming ready
13594
PID TTY STAT TIME COMMAND
Stopping realtime threads
Unloading hal components
So there seems to be a problem with the range of values, right?
The input values of the PNOZmulti device are 0...127and output are 8192...8319.
Any ideas?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Away
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
29 Mar 2017 14:44 #90508
by Todd Zuercher
Replied by Todd Zuercher on topic Signal for safety control watchdog
I was typing a reply to your last message (that you deleted I think) suggesting that very thing (about the W), and it disappeared when I clicked submit.
Unfortunately I have no experience with using mb2hal using TCPIP, my machine uses RTU.
First thing i would try is to take out all the spaces around the "=" in the mb2hal.ini file (I'm not sure it will work with those extra spaces.)
Unfortunately I have no experience with using mb2hal using TCPIP, my machine uses RTU.
First thing i would try is to take out all the spaces around the "=" in the mb2hal.ini file (I'm not sure it will work with those extra spaces.)
Please Log in or Create an account to join the conversation.
Time to create page: 0.099 seconds