3/29/2021 11:43 PM | |
Joined: 6/4/2008 Last visit: 3/20/2023 Posts: 1419 Rating:
|
Hi All, I'm having difficulty with particular pointer types, see attachments Essentially the application is a CNC router. I have generated some ASCII character geometries and all works perfectly well if I inject the geometry name (i.e. "A".Geometry) directly into the "pathdata" parameter of the called FB "LKinCtrl_MC_MovePath" The Geometries are of the type "LKinCtrl_typePathData_advanced" However, I have created a Case statement that I want to use to detect characters by their ASCII equivalents and then substitute the correct geometry into the pathdata input parameter of the Movepath FB Unfortunately, whilst everything compiles happily, the PLC stops with a NIL PTR fault which I know means the pointer is not working (or still nullified) Note: I'm aware the blank FB Movepath calls for a type Variant for the pathdata parameter, but it will not allow me to use type Variant in any declarations for some reason. It's derived from the application example of a GCODE to Movepath For reference here Can someone please try and "point" me in the right direction as I'm somewhat of a novice programmer still. PLC details 1515TF-2 PN (V2.8) Regards, Graeme Attachmentscreenshots.zip (141 Downloads) |
Last edited by: Jen_Moderator at: 03/30/2021 08:48:17Optimized link. |
|
3/30/2021 12:54 AM | |
Joined: 7/7/2010 Last visit: 3/29/2023 Posts: 13213 Rating:
|
You can try the ?= combined with the <> NULL check. I searched for help on the ?= SCL MOVE group command right from the instruction pane and saw what you were looking for - I think. Read the documentation to see if it applies - or _can_ apply - to your situation. By _can_ I mean if you can coerce your FB, or something in front of the call to the FB to ensure the value coming into the FB is NOT NULL. Since you know something crashes when a null is passed in and your code _could_ pass in a NULL, the best course is to avoid calling the FB when the thing is null. Hope this helps and is what you were looking for, at least to get past the NULL reference.
|
science guy |
|
Follow us on