Changing Output

Make your own CNC Control Apps

Moderator: cnckeith

Post Reply
Gerral
Posts: 24
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

Post by Gerral »

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.


ASPeters
Posts: 26
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

Post by ASPeters »

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


Gerral
Posts: 24
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

Post by Gerral »

Works great! I don't know how I missed that in the documentation.

Thanks!


cncsnw
Posts: 4237
Joined: Wed Mar 24, 2010 5:48 pm

Re: Changing Output

Post by cncsnw »

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).


Gerral
Posts: 24
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

Post by Gerral »

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!


Post Reply