I'd like to change the state of an output using my C# program but cannot figure it out.
I've tried using M95/M94 in a RunCommand but it doesn't seem to work with macros, or at least it's not changing the output.
Any ideas?
Thank you in advance.
Changing Output
Moderator: cnckeith
-
- Posts: 28
- Joined: Fri Nov 22, 2024 4:25 pm
- Acorn CNC Controller: Yes
- Plasma CNC Controller: No
- AcornSix CNC Controller: No
- Allin1DC CNC Controller: No
- Hickory CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B4107B77A373-0905248481
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Changing Output
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 32
- Joined: Thu Feb 10, 2022 5:55 pm
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Changing Output
CNCPipe.plc.SetIoForceState(int ioBit, BitType bitType, ForceState state) should do what you're looking for. You'll want to use BitType.Output and then either ForceState.ForcedOn or ForceState.ForcedOff
1 user liked this post
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 28
- Joined: Fri Nov 22, 2024 4:25 pm
- Acorn CNC Controller: Yes
- Plasma CNC Controller: No
- AcornSix CNC Controller: No
- Allin1DC CNC Controller: No
- Hickory CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B4107B77A373-0905248481
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Changing Output
Works great! I don't know how I missed that in the documentation.
Thanks!
Thanks!
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
Re: Changing Output
Presumably that will preclude controlling that output in any way with the PLC program, but as long as that is what you want, it is a reasonable solution.
More generally, outputs are controlled by the PLC program, and skinning applications send requests to the PLC program (e.g. via SV_SKIN_EVENT_nn) when they want the PLC program to turn a device on or off.
That way the PLC can still do its job of applying interlocks, turning devices off when an error or fault occurs, or allowing other methods of controlling the same device (e.g. jog panel keys or M functions).
More generally, outputs are controlled by the PLC program, and skinning applications send requests to the PLC program (e.g. via SV_SKIN_EVENT_nn) when they want the PLC program to turn a device on or off.
That way the PLC can still do its job of applying interlocks, turning devices off when an error or fault occurs, or allowing other methods of controlling the same device (e.g. jog panel keys or M functions).
1 user liked this post
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
(Note: Liking will "up vote" a post in the search results helping others find good information faster)
-
- Posts: 28
- Joined: Fri Nov 22, 2024 4:25 pm
- Acorn CNC Controller: Yes
- Plasma CNC Controller: No
- AcornSix CNC Controller: No
- Allin1DC CNC Controller: No
- Hickory CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: B4107B77A373-0905248481
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Changing Output
thanks you may have made me realize one of my problems as my M94/M95 is no longer working even though I've "unforced" these outputs.
I'll change it to use the SV_SKIN_EVENT
Thanks!
I'll change it to use the SV_SKIN_EVENT
Thanks!
(Note: Liking will "up vote" a post in the search results helping others find good information faster)