Functional overview
-
Richard Cullin
- Site Admin
- Posts: 152
- Joined: Sat Jun 02, 2012 4:45 pm
Re: Functional overview
thanks art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Functional overview
Richard:
New version is online, if you call myser.ReadData() to get a string, at the same time
myser.Table is filled with integers of the incoming values. So to use byte 6,7 youd use
str = myser.ReadData( 8 );
byte6 = myser.Table[6];
byte7 = myser.Table[7]; //assuming byte 0 numbering of course..
Art
New version is online, if you call myser.ReadData() to get a string, at the same time
myser.Table is filled with integers of the incoming values. So to use byte 6,7 youd use
str = myser.ReadData( 8 );
byte6 = myser.Table[6];
byte7 = myser.Table[7]; //assuming byte 0 numbering of course..
Art
Last edited by ArtF on Fri Jan 06, 2017 9:12 pm, edited 1 time in total.
-
Richard Cullin
- Site Admin
- Posts: 152
- Joined: Sat Jun 02, 2012 4:45 pm
Re: Functional overview
thanks I will give a try
-
Richard Cullin
- Site Admin
- Posts: 152
- Joined: Sat Jun 02, 2012 4:45 pm
Re: Functional overview
still in a bit of trouble, very nearly works
data returned @6000 rpm is 0x2a,0x9d for table[4],table[5]
very good
but table[5] is interpreted as signed so 0x2a * 256 =10752 + 0x9d needs to be 10909 not 10653
I think this is happening to the setspeed calcs too
how can I get to use unsigned values ?
code
global GetVfdSpeed = function( )
{
CRC=0xffff;
vfd={1,4,3,1,0,0};
for (inx=0;inx<tableCount(vfd);inx+=1)
{
CRC=Crc16(CRC,vfd[inx]);
};
// print("the CRC " + CRC);
vfd[7]=ToInt(CRC/256);
vfd[6]=ToInt(CRC%256);
myser.Table = vfd;
myser.SendTable();
//sleep(1);
while( myser.DataWaiting() <8) { yield();};
print("buff depth " + myser.DataWaiting() );
//str = myser.GetData();
//print( "buffer "+str );
bd=myser.DataWaiting();
string = myser.ReadData(bd );
vfdrpm=(myser.Table[bd-4]*256+myser.Table[bd-3])*55/100;
print("high " + myser.Table[4] + " low " + myser.Table[5] );
print("Rpm read " + vfdrpm );
return vfdrpm;
};
data returned @6000 rpm is 0x2a,0x9d for table[4],table[5]
but table[5] is interpreted as signed so 0x2a * 256 =10752 + 0x9d needs to be 10909 not 10653
I think this is happening to the setspeed calcs too
how can I get to use unsigned values ?
code
global GetVfdSpeed = function( )
{
CRC=0xffff;
vfd={1,4,3,1,0,0};
for (inx=0;inx<tableCount(vfd);inx+=1)
{
CRC=Crc16(CRC,vfd[inx]);
};
// print("the CRC " + CRC);
vfd[7]=ToInt(CRC/256);
vfd[6]=ToInt(CRC%256);
myser.Table = vfd;
myser.SendTable();
//sleep(1);
while( myser.DataWaiting() <8) { yield();};
print("buff depth " + myser.DataWaiting() );
//str = myser.GetData();
//print( "buffer "+str );
bd=myser.DataWaiting();
string = myser.ReadData(bd );
vfdrpm=(myser.Table[bd-4]*256+myser.Table[bd-3])*55/100;
print("high " + myser.Table[4] + " low " + myser.Table[5] );
print("Rpm read " + vfdrpm );
return vfdrpm;
};
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Functional overview
lol.. my bad. Ill probably have to do that for you when I pack them. Ill check it out.
Art
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Functional overview
Richard:
Just uploading now a proper unsigned int version..
Art
Just uploading now a proper unsigned int version..
Art
-
Richard Cullin
- Site Admin
- Posts: 152
- Joined: Sat Jun 02, 2012 4:45 pm
Re: Functional overview
downloaded new version and tried again this morning, its no different . did I jump the gun ?
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Functional overview
Richard:
I doubt it, it likely just didnt work. ( I have no serial device so Im writing the code a bit blind).
Ill do an internal trace and get back to you..
Art
I doubt it, it likely just didnt work. ( I have no serial device so Im writing the code a bit blind).
Ill do an internal trace and get back to you..
Art
-
ArtF
- Global Moderator

- Posts: 4557
- Joined: Sun Sep 05, 2010 5:14 pm
- Contact:
Re: Functional overview
Richard:
Try it now, Ive tested it sends proper integers..
Art
Try it now, Ive tested it sends proper integers..
Art
-
Richard Cullin
- Site Admin
- Posts: 152
- Joined: Sat Jun 02, 2012 4:45 pm
Re: Functional overview
fixed , thanks art
do you have any thoughts re a pendant/mpg for auggie ?
I have a vista_cnc mach3 pendant, could auggie ever support 3rd party addons like that as mach3 does ?
one of the things that led me down the auggie track was that the Chinese motion controller I was using did not support probing g31,g38 [afaikr] style via mach3 and the pokeyscnc57 does . probing just one more thing to think about I don't think a script alone could get the timing correct for accurate position at contact
do you have any thoughts re a pendant/mpg for auggie ?
I have a vista_cnc mach3 pendant, could auggie ever support 3rd party addons like that as mach3 does ?
one of the things that led me down the auggie track was that the Chinese motion controller I was using did not support probing g31,g38 [afaikr] style via mach3 and the pokeyscnc57 does . probing just one more thing to think about I don't think a script alone could get the timing correct for accurate position at contact