Clearing M1nn Effect

More
09 Aug 2016 04:51 #78512 by soroosh.av
Hi Friends

I've defined an User defined M Code that triggers an input of classicladder tot do some works in classicladder and standard_pinout.
It's working as i want but i don't know how can i clear it's effect (reset that classicladder input) for the next cycle. Anyone can help me out fix this?

Please Log in or Create an account to join the conversation.

More
09 Aug 2016 12:18 #78522 by Todd Zuercher
Replied by Todd Zuercher on topic Clearing M1nn Effect
You might need to tell us more about what is going on. Such as what is in the M-codes file, the classic ladder file, and any related hal files.
At this point I'm just guessing what is going on.
Does the M-code set a pin or signal true (or false), then classic ladder does it's thing, and then what exactly is the problem? Is it that the pin state set by the M-code needs to be reset to it's original state or just something in the ladder?
The following user(s) said Thank You: soroosh.av

Please Log in or Create an account to join the conversation.

More
10 Aug 2016 03:59 #78556 by soroosh.av
Replied by soroosh.av on topic Clearing M1nn Effect
M Code sets an input pin of Classicladder True and i wanted to rest this pin after some works. I've set it False just after setting it True as below and it gave me a rising trig in classicladder. That was enough to set a bit memory and do what i want and reset that bit easily.

#!/bash/bin
#reference point cycle
halcmd setp classicladder.0.in-07 True
halcmd setp classicladder.0.in-07 False
exit 0

Thanks for your attention anyway.

Please Log in or Create an account to join the conversation.

More
10 Aug 2016 14:57 #78576 by Todd Zuercher
Replied by Todd Zuercher on topic Clearing M1nn Effect
That was precisely what I was going to suggest (if that was what you were after). Glad you got it sorted.

Please Log in or Create an account to join the conversation.

More
18 Aug 2016 14:35 #78997 by andypugh
Replied by andypugh on topic Clearing M1nn Effect

#!/bash/bin
#reference point cycle
halcmd setp classicladder.0.in-07 True 
halcmd setp classicladder.0.in-07 False 
exit 0


This might not be 100% reliable. CL might well miss the transition between poling events.
For 100% reliability you would probably want to set an output bit in CL to tell the script that the trigger has been seen, and only then reset the pin to false.

Please Log in or Create an account to join the conversation.

More
29 Aug 2016 03:20 #79634 by soroosh.av
Replied by soroosh.av on topic Clearing M1nn Effect
I would appreciate if you help me to do this, because i don't know how can i read the Classicladder output in that part program and how to associate it to reset the pin.

Please Log in or Create an account to join the conversation.

More
29 Aug 2016 03:49 #79635 by Todd Zuercher
Replied by Todd Zuercher on topic Clearing M1nn Effect
I would have just added something like this to the M-code to make sure there was time for the change to be detected.
#!/bash/bin
#reference point cycle
halcmd setp classicladder.0.in-07 True 
sleep .100
halcmd setp classicladder.0.in-07 False 
exit 0

Please Log in or Create an account to join the conversation.

More
29 Aug 2016 19:37 #79686 by andypugh
Replied by andypugh on topic Clearing M1nn Effect
Better still would be to wait to ensure that an output changes in CL to acknowledge the signal.

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds
Powered by Kunena Forum