- Posts: 58
- Thank you received: 0
Implement IO judgment in NGC files?
4 years 7 months ago #236153
by chen1234
Implement IO judgment in NGC files? was created by chen1234
I've been having trouble writing G-code recently and was hoping someone could give me some hints.
I need to implement IO judgment in a .ngc file, such as the function of M66, but it can be implemented directly in G code
test.ngc:
Is there a way to program it directly in the NGC file?
I need to implement IO judgment in a .ngc file, such as the function of M66, but it can be implemented directly in G code
test.ngc:
Code:
...
if M101 == ture
...
Please Log in to join the conversation.
4 years 7 months ago #236156
by MaHa
Replied by MaHa on topic Implement IO judgment in NGC files?
You can use this in a ngc file
Code:
M66 P1 L0
#<ABC> = #5399
o803 IF [#<ABC> EQ 1]
......
o803 ENDIF
Please Log in to join the conversation.
4 years 7 months ago #236157
by chen1234
Replied by chen1234 on topic Implement IO judgment in NGC files?
thanks,MaHa
I have other little questions
How many pins can M66 define? I see in the documentation that there are 3 each for digital and analog signals, is there any way to expand this number?
Or how to combine this function with PLC?
I have other little questions
How many pins can M66 define? I see in the documentation that there are 3 each for digital and analog signals, is there any way to expand this number?
Or how to combine this function with PLC?
Please Log in to join the conversation.
4 years 7 months ago #236158
by andypugh
Replied by andypugh on topic Implement IO judgment in NGC files?
You can increase the io using the "num_dio" parameter to the "loadrt motmod" command.
Depending on the structure of your HAL / INI files this might need to be done either as a change to the HAL file, or to a parameter read in to the HAL from the INI.
linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
Depending on the structure of your HAL / INI files this might need to be done either as a change to the HAL file, or to a parameter read in to the HAL from the INI.
linuxcnc.org/docs/2.8/html/man/man9/motion.9.html
Please Log in to join the conversation.
4 years 7 months ago #236159
by MaHa
Replied by MaHa on topic Implement IO judgment in NGC files?
In checked my config, end of this line the amount of analog and digital inputs are set, if you need more than available by default.
I have used this only from hal
Code:
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS num_aio=16 num_dio=8
I have used this only from hal
Code:
net cb11 pyvcp.checkbutton11 motion.digital-in-01
Please Log in to join the conversation.
4 years 7 months ago #236160
by chen1234
Replied by chen1234 on topic Implement IO judgment in NGC files?
Thanks ,andy, MaHa
I will try to expand the number of IOs.
I have a new question, I want to add PLC function, how can this PLC be used with M66?
I will try to expand the number of IOs.
I have a new question, I want to add PLC function, how can this PLC be used with M66?
Please Log in to join the conversation.
4 years 7 months ago #236175
by andypugh
Replied by andypugh on topic Implement IO judgment in NGC files?
A real PLC or a soft PLC (ie, ClassicLadder)?
I think that you would connect the PLC inputs and outputs to the same motion pins that you are already using, in the HAL layer.
linuxcnc.org/docs/2.8/html/ladder/ladder-intro.html
I think that you would connect the PLC inputs and outputs to the same motion pins that you are already using, in the HAL layer.
linuxcnc.org/docs/2.8/html/ladder/ladder-intro.html
Please Log in to join the conversation.
Time to create page: 0.083 seconds
