Macro_capability_detailed.htm - suggested corrections

This section is for Users that want to create and share Documentation about UCCNC.

Macro_capability_detailed.htm - suggested corrections

Postby Robertspark » Mon Sep 26, 2016 12:25 pm

I thought I'd start a thread which could be added to. The idea being that to help CNCdrive, they could copy and paste text out of the thread and correct / add to the Macro_capability_detailed.htm file.

here to help, if someone is offended by the suggestions, just delete the thread

This has come out of doing the notepad++ autocomplete + styling addin


I suspect that the following function return "int" and not "void"

Function: int Getanaloginput(int channel)
Description: This function returns the actual value of an analog input channel signal. The parameter defines the channel to be read. If the device has no analog input channel with the channel number called then the return value will be -1. The valid return range for the function is 0-65535.
Example: int analogin1 = exec.Getanaloginput(1);


Function: int Getanalogoutput(int channel)
Description: This function returns the actual value of an analog output channel signal. The parameter defines the channel to be read. If the device has no analog output channel with the channel number called then the return value will be -1. The valid return range for the function is 0-65535.
Example: int analogout1 = exec.Getanalogoutput(1);


typographical error: I've corrected the speechmarks, so if like me, someone else copies the example function and then edits it it will display & run correctly

Function: void Code(string code)
Description: This function is the most complex of all, it makes it possible to execute G-code from inside a macro. The G-code is sent as a string in the parameter of the function and is interpreted at execution time.
Example: exec.Code("G0 X10 Y20 Z0");



A few missing functions, that can be added to the file for completeness:

Function: void exec.AddStatusmessage( string StatusMessage )
Description: Adds a message to the Status Listbox
Example: exec.AddStatusmessage( "Check Ohmic Probe" );


Function: void AS3.Additemtolist(string val, int labelnumber)
Description: Adds a string value to a Listbox with the corresponding labelnumber.
Example: AS3.Additemtolist( "Check Ohmic Probe" , 18);



Modbus Macros Functions:

ushort[] GetAllModbusArray()
Reads the whole modbus register table.

bool SetModbusregister(int Registernumber, ushort Value)
Writes a single register in the modbus register table.

bool SetModbusregisters(int Startregister, ushort[] Values)
Writes multiply registers in the modbus register table.

bool GetModbusregister(int Registernumber, out ushort Value)
Reads a single register from the modbus register table.

bool GetModbusregisters(int Startregister, int Registercount, out ushort[] Values)
Reads multiply registers from the modbus register table.

void WriteModbusString(string String, int Startregister, bool HightoLowByteorder)
Converts a string into an ushort array and writes it into the modbus register table.

In the functions where the return value is boolean indicates if the function got executed with
or without problems. The true return value means that the function executed without
problems while false means that a problem has occurred and the retrieved variable(s) values
may be corrupt.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro_capability_detailed.htm - suggested corrections

Postby Robertspark » Tue Sep 27, 2016 12:18 am

Is there a difference between
Code: Select all
exec.getLED();


And,

Code: Select all
AS3.getLED();


Both seem to work the same, but only the latter is listed in the macro_detailed....htm file.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro_capability_detailed.htm - suggested corrections

Postby A_Camera » Wed Sep 28, 2016 11:01 am

I created a separate document containing everything needed, including object numbers. In my opinion that is much better than having separate pdf files. It is a pretty large document, but at least as far as I know it is complete.
A_Camera
 
Posts: 638
Joined: Tue Sep 20, 2016 11:37 am

Re: Macro_capability_detailed.htm - suggested corrections

Postby ger21 » Wed Sep 28, 2016 11:42 am

We really need a complete document with ALL functions listed.
I hate to have to browse through existing macros to find certain functions.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Macro_capability_detailed.htm - suggested corrections

Postby A_Camera » Wed Sep 28, 2016 12:49 pm

Yes, I agree. That's why I created that document. It contains as far as I know everything necessary, all the pdf documents related to macro programming. I don't want to share it for now because it needs some editing, but will share it as soon as I have done that work. Currently it is about 80 pages, but I think it is better this way than having to go through several different pdf files.
A_Camera
 
Posts: 638
Joined: Tue Sep 20, 2016 11:37 am

Re: Macro_capability_detailed.htm - suggested corrections

Postby Robertspark » Wed Sep 28, 2016 5:37 pm

..... draft macro manual anyone?? :roll: :roll:

https://drive.google.com/open?id=0B9eqGqWQVBbWNVhsZkdfQWRaYTg

It will be contents clickable & maybe have an index too
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro_capability_detailed.htm - suggested corrections

Postby Robertspark » Wed Sep 28, 2016 7:28 pm

draft manual updated a little..... (same link above).....

I'm now at a crossroads over the index..... how to index it ........ do I index every function and LED, FIELD, BUTTON etc..... or do I cut it down to something else?

Indexing everything will automatically sort it alphabetically..... but it may be a whole lot of info

suggestions would be good if you're interested in such a doc.
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Macro_capability_detailed.htm - suggested corrections

Postby cncdrive » Wed Sep 28, 2016 9:32 pm

Hi Rob,

The manual looks great, thank you for your efforts with making it!
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Macro_capability_detailed.htm - suggested corrections

Postby cncdrive » Wed Sep 28, 2016 9:34 pm

Robertspark wrote:Is there a difference between
Code: Select all
exec.getLED();


And,

Code: Select all
AS3.getLED();


Both seem to work the same, but only the latter is listed in the macro_detailed....htm file.


As far as I see both functions doing the exact same thing, I'm not sure why the function was duplicated though in the exec and AS3 objects, probably it was just a mistake.
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Macro_capability_detailed.htm - suggested corrections

Postby Robertspark » Wed Sep 28, 2016 9:48 pm

No problem, happy to do it (I tend to remember stuff better this way by going through the codes)

Once its done I'll publish the Microsoft Office file, that way if anyone in the future wants to update it someone else can pick up on it, but I'll try to keep up with the revision updates (should be easy once the initial document is sorted) [one failing of these sorts of documents is people loose interest over time ... hence I think the Mach3 manuals + vb macro PDF's did not reflect the current version by a long way]. The information is all freely available its just in one file and searchable through the contents, index and word search too (CTRL + F).

I have edited some of the text a little to make it more readable and spellings etc (yes I'm pedantic :roll: ... day job: I am a consulting engineer ... its either right or wrong...) + I'm sure you blokes at CNCdrive are fluent in more languages than I (failing of having English as a first language, I understand dutch too though so not too bad, can't write it though)

I've left the uccnc version as 1.2022 at present as my plan is to finish it then pick up on anything in 1.2023 (if there is anything) and then it can be classed as "final" subject to later revisions as new stuff comes out.

I've been updating the googledrive file a few times this evening, hence if you download it at anypoint and are interested in it pop back whenever to see it develop as it has changed (I've re-pdf'd it about 4/5 times this evening as its progressed)..... just sorting the index now, may add in some example macros if there is something to copy from the uccnc manual (as I copied the bit from the modus section).

If anyone is not sure about what functions are available within uccnc, a quick check of the index provides a short and clear alphabetical list (same with buttons, LEDs (wow, a lot of them!), etc etc)
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Next

Return to User Documentation

Who is online

Users browsing this forum: No registered users and 1 guest