Hi,
does that mean if you don't understand you shouldn't mess with it?
No, there is no danger per se in using the functions but rather there are better ways (normally) to do the same
thing.
do you mean an API or Mach variable being "exposed" as in being readily available/ easy to find/ apparent ?
As an example, you will no doubt have seen in the Enums and Pound variable lists the specific location/name of
the variable containing the current axis positions. You could read that memory location and get the data. However the
correct way to do so is with the mcAxisGetMachinePos() API. No doubt internal to Mach the API function reads and
returns the same Pound variable. If however the location of that variable changes, say in a more recent build, the code that
you used to read the data direct is now broken whereas the API would still work given that the API would be self consistent
with the new build.
The API mcAxisGetMachinePos() is a function that is 'exposed' so that a user might use it rather than the more direct method.
The same applies with the scr.********* functions. The manipulation of screen elements can be done with them directly but
preference is given to the APIs which 'expose' the same functionality.
Does that mean that the APIs are easy to find? Well they are documented, mostly, and mostly up to date, but they are
documented. It is true there are hundreds of APIs and it takes a lot of learning to be able to recognize and use them at will,
but they are not hidden.
if statements slowing down the plc script and
the SigLib{} approach is the better answer, if i make lots of functions in the SigLib{} will that mess things up too? any limits there ?
No, not really, any function or code you put in the SigLib{} table will only ever be executed IF the entry
matches the variable 'sig'. Consequently all those extra funtions add zero processing overhead beyond the
entry matching test. It is indeed this feature that makes the SigLib{} such an elegant solution.
no idea what a Enums is
An Enum is short for 'enumerator'. For example mc.mcISIG_INPUT4 is actually a number, in fact the number 3, being
the (0, 1, 2) 3rd input. Much easier for humans to remember ISIG_INPUT4 than a plain old '3'. When the code is
compiled the compiler will substitute the number for the Enum, but that detail is not apparent to us for all its importance
to the computer running the code.
surprising the person who replied to my message is local
Should I assume you are in Canterbury somewhere? I used to live in Akaroa and had done for many years but have
shifted recently to Selwyn Huts on the shore of Lake Elesmere.
Craig