I am stumped on how to actually get a custom button in the VCP to trigger an input in the PLC .src program. The centroid tech support intro to VCP video talks about how they are going to explain this in 'the next video'. Well there is no next video.
I have made buttons, installed them in the VCP and they are visually there, made matching folders and .xml files that I think are right? But how to they hook into the PLC? Editing the xml file is a bit confusing. Skin events and LED output numbers are a bit confusing. Is the output number the same as the input in the PLC software?
Looking at an existing button like Aux1key_I IS INP1059. How does the PLC know to reference that 1059 in the XML file?
I made a couple of new buttons using IMP1122 and IMP1123. I don't think those are used elsewhere (?) and a XML file using those numbers. Have a look at the screenshot.
Yes I compiled, rebooted the MPU and restarted CNC12.
Also I am an experienced PLC programmer and this is my first kick at the can at Centroid. I suck still so don't assume I am doing anything right.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Fri Jan 27, 2023 3:13 pm
by Thinkin
*crickets*
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Fri Jan 27, 2023 5:03 pm
by cnckeith
post a fresh report.zip for starters so we can see your CNC setup files and customizations etc.
what specific functionality are you working on accomplishing? this would help to see the big picture to get good advice.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Fri Jan 27, 2023 5:37 pm
by cncsnw
Each VCP button has a "skin event number", specified with the <skin_event_num> element in that button's XML file.
In the PLC program, the state of a button is reflected in the corresponding "SV_SKIN_EVENT_nn" system variable.
If the button is being pressed, the system variable is 1/on/true. If the button is not being pressed, the system variable is 0/off/false.
In a typical VCP-enabled PLC program source file, you will find definitions assigning appropriate names to commonly-used skin event system variables. For example:
You can create your own, or redefine one that you don't need. According to the PLC programming manual, there are 255 such bits available.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Fri Jan 27, 2023 6:58 pm
by Thinkin
Aha, Skin Event numbers! That is what I am missing. I will do a little more reading but that’s probably the ticket.
@cnckeith I am trying to write my own tool changer software for a swing arm style cnc mill. Or at least get it all working manually and then see how my patience is holding up.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Mon Jan 30, 2023 3:52 pm
by cnckeith
skin events are introduced in the vcp manual as well.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Mon Jan 30, 2023 6:04 pm
by Thinkin
Yes it's just ...a bit confusing the way the manual is laid out. Especially when starting from zero experience coding outside of PLC land.
They should put up that second video that promised to explain this in better detail.
I'll chip away at this in my spare time and see if I can make some spare time, and post an update.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Tue Jan 31, 2023 3:37 pm
by cnckeith
hmm i wrote the manual and did the video. sorry its confusing to you, what specifically are you having issue with?
explain the goal and how you are going about it. goal = a CNC function or feature, so explain what you are trying to do and we'll give you advice on how to approach it. Most users don't need to know anything about VCP skin events, but some that want to customize the PLC may. So lets determine that first, said another way What function do we want, then we will look to see if that is already 'canned' or not then proceed with customization if the function is not already available.
Re: PLC to VCP communication/VCP buttons (All-In-One)
Posted: Tue Jan 31, 2023 6:46 pm
by Thinkin
I’ll get back to you guys when I get back to this. Days booked to work on this machine this week are turning into emergency calls. I’m pretty sure the first post is it.
A video on making a custom button from zero would be great. But I’ll keep poking at this and update when I have time.
Re: PLC to VCP communication/VCP buttons (All-In-One)