Error loading profile

If you have a question about the software please ask it here.

Re: Error loading profile

Postby Ian » Wed Mar 08, 2017 8:06 pm

cncdrive wrote:OK, I have checked and the problem is that 2 keys' value are blank in your profile, these:

Spindleminvelocity=
Spindlemaxvelocity=

The keys are defined but have no value which is not allowed, because these are double (number) types.

The UCCNC can't write these keys blank, because writting the keys is done with a conversion from a numeric type, so it can't remain blank when the UCCNC writes these keys.
I suspect the HYPLUGIN.dll to write these keys blank, because I see that is the only plugin you have enabled in your profile and it is about the spindle, so I think it is probably writting these keys.


Thanks for checking, yes I'm looking at configuring my Huanyang spindle, so I switched on the plugin to look at it, I'll leave it off till I'm ready.

Thanks
Ian
Ian
 
Posts: 7
Joined: Sat Feb 11, 2017 2:55 pm
Location: Switzerland

Re: Error loading profile

Postby Dan911 » Wed Mar 08, 2017 10:30 pm

Ian wrote:
cncdrive wrote:OK, I have checked and the problem is that 2 keys' value are blank in your profile, these:

Spindleminvelocity=
Spindlemaxvelocity=

The keys are defined but have no value which is not allowed, because these are double (number) types.

The UCCNC can't write these keys blank, because writting the keys is done with a conversion from a numeric type, so it can't remain blank when the UCCNC writes these keys.
I suspect the HYPLUGIN.dll to write these keys blank, because I see that is the only plugin you have enabled in your profile and it is about the spindle, so I think it is probably writting these keys.


Thanks for checking, yes I'm looking at configuring my Huanyang spindle, so I switched on the plugin to look at it, I'll leave it off till I'm ready.

Thanks
Ian



Hi Ian,

I removed the code that writes to your Pro file for now in file below until I find time to look at. Sorry for your troubles and remember to set your min and max rpm.

Dan

HYPLUGIN93.rar.zip
(8.59 KiB) Downloaded 854 times
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Error loading profile

Postby A_Camera » Thu Mar 09, 2017 7:58 am

Dan911 wrote:
cncdrive wrote:Hi Dan,

I think it would be even better to not even allow users to type in other than numbers if the textbox has to contain a number only.
Here is a little function for you which checks if the keys the user pressed are numeric characters and not allowing other characters to be inserted into the checkbox:

Code: Select all
private void Checkifnumber(object sender, KeyPressEventArgs e)
{
      if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && (e.KeyChar != '.'))
      {
          e.Handled = true;
      }

     // only allow one decimal point
      if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1))
      {
          e.Handled = true;
      }
}


Just attach a Keypress Event to the textboxes of interest and call the above function.


That's great and will do! I will also add a Null or empty check in the shut down event, if null or empty don't write.

Thanks,
Dan

Must allow also ABCDEF and abcdef if hex is allowed or required to be entered, like in the Modbus plugin we are discussing on the zone.
A_Camera
 
Posts: 639
Joined: Tue Sep 20, 2016 11:37 am

Re: Error loading profile

Postby cncdrive » Thu Mar 09, 2017 10:10 am

The function can be freely modified to accept ABCDEF or whatever needed.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Error loading profile

Postby A_Camera » Thu Mar 09, 2017 1:50 pm

cncdrive wrote:The function can be freely modified to accept ABCDEF or whatever needed.

Yes, I know. I just wanted to note because currently Dan and I are having a conversation on CNC Zone and in his simple Modbus plugin some of the fields require hex values.
A_Camera
 
Posts: 639
Joined: Tue Sep 20, 2016 11:37 am

Re: Error loading profile

Postby cncdrive » Thu Mar 09, 2017 5:18 pm

Yep, depending on what the task is it could be one option to ask for the number in Decimal (algorism) and the software can convert it to Hexadecimal.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Error loading profile

Postby A_Camera » Thu Mar 09, 2017 6:23 pm

Vmax549 wrote:Normally with a Human interface you would want ALL the values entered to be AlphaNumeric in nature and let teh plugin convert it to what is required.

Just a thought, (;-) TP

I guess you mean "ALL the values entered to be Numeric" not alphanumeric. Alphanumeric includes ALL characters of the alphabet, not only numbers and A - F. Most people think about numeric values as decimal values made up of numeric characters, i.e. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 without the letters a - z and A - Z.

...but it is up to the programmer to decide if he/she wants something to be entered in a different format. Some times it is very logical to use other formats. In the case of the plugin I would have chosen decimal format and would convert it internally if necessary, but I am not the programmer of that plugin.
A_Camera
 
Posts: 639
Joined: Tue Sep 20, 2016 11:37 am

Re: Error loading profile

Postby Dan911 » Fri Mar 10, 2017 2:48 am

IMO.... I think the plugin writer has to take all preventive measures to make sure your code regardless what user inputs doesn't make program crash. After that the user has to be held accountable for reading/following instruction, otherwise you can end up with pages of code.

In the HYPLUGIN setup window I have instructions followed by and example on top of these textboxes. This is also in setup instructions included with zip. After input there's a check to make sure this var isn't 0 or empty before written to pro file. Balazs pointed out my flaw and provided me with code to prevent this for these to checkboxes only(min, max Rpm) or I may just use Regex to remove unwanted chars to avoid continuous MesseageBox windows. Will see what works best this weekend when I have a chance to play.

As far as Modbusez goes... Does it really matter if you instruct to input decimal or hex? With a search you can get dozens of converters with a click. Besides my goal here was...
"If you have this VFD input this".
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Error loading profile

Postby A_Camera » Fri Mar 10, 2017 8:24 am

Dan911 wrote:IMO.... I think the plugin writer has to take all preventive measures to make sure your code regardless what user inputs doesn't make program crash. After that the user has to be held accountable for reading/following instruction, otherwise you can end up with pages of code.

Basically I agree, error checking and preventive control, data validation are important. But there is no way you or anyone else can cover every possible mistake which can be made. If the instructions are given and clear then it is up to the user to either follow them or ask for support, help or clarifications. But there must be instructions which explain as much as possible, clearly but not too wordy so that users can read them without losing patience. Many people read manuals and instructions, and those who don't, ...well, they learn the hard way.


Dan911 wrote:As far as Modbusez goes... Does it really matter if you instruct to input decimal or hex? With a search you can get dozens of converters with a click. Besides my goal here was...
"If you have this VFD input this".

In the case of the easy Modbus plugin, I think it is more complicated. For addresses it does not matter if they must be entered in decimal or hex format, as long as it is clear which one is expected and proper checks are made inside the plugin to validate the entered value. As you say, there are plenty converters freely available so if one manual states the addresses in decimal format it is easy to convert to hex. Regarding the commands it is not that simple any more because they are normally not stated as any other values than bit information and different bits in a word can have different meanings, and it is up to the users to interpret and convert those bits to a binary value which then of course easily can be converted to decimal or hex, whichever is needed. So, in my opinion, if it is supposed to be an easy interface than the commands should be entered in binary format because that is what the VFD manuals are using, but of course, that would make it more complicated for the programmer.

But then, what you (and I and many others) are doing is free labor for others who can't figure out all the bits and pieces needed for making it work, so at least some user effort should not be entirely unexpected. The main thing is that instructions are short, clear and easily understood.
A_Camera
 
Posts: 639
Joined: Tue Sep 20, 2016 11:37 am

Re: Error loading profile

Postby Dan911 » Fri Mar 10, 2017 1:19 pm

Vmax549 wrote:HIYA DAN , Do you really think they are going to READ your instructions ??? :o THAT is not the way of a DIYer OR most other users for that matter . And yes teh way of teh programmer is to write 100 lines of usefull code THEN add in another 500 lies of code just to protect teh program from teh sillies who will not read the instructions or listen to sound advice. THEN have to go back and add in another 1000 lines to make it work the way THEY think it should work not the way YOU think it should work. :roll:

A lot of DIY users are also TERRIFIED of CNC machine STANDARDS cause that is NOT the way my DIY "Brand X " did it.

Welcome to the world of DIY CNC .

Just a thought, (;-) TP


Hi TP,

When I say manual I mean a list of steps to get up and running. Most may try it first like I would but if troubles will reference back to instructions and thread they downloaded from.
So yes, I do think they will read.

As far as a 100 lines of useful code and 500 lines for sillies to prevent exceptions/crash I agree with, a 1000 lines for the way they expect it to run I don't. Everyone has different views and you will be chasing your tail trying to make all happy. This thread is a perfect example.

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

PreviousNext

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 18 guests