Linking spin box to parameter using conv-floaty32

More
01 May 2019 14:51 #132441 by microsprintbuilder
I’m trying to connect values from a spin box in my panel to some stepgen values to control on, off, and frequency of the stepgen that runs spark box for edm. I get a error value invalid.
Attachments:

Please Log in or Create an account to join the conversation.

More
01 May 2019 15:52 #132445 by microsprintbuilder
Attachments:

Please Log in or Create an account to join the conversation.

More
01 May 2019 15:53 #132446 by microsprintbuilder
Attachments:

Please Log in or Create an account to join the conversation.

More
01 May 2019 23:08 #132466 by BigJohnT
It's better to copy and paste the text if possible, I can't quite read the error photo but it might be a type error like trying to use a float where it should be u32 etc.

I don't know anything about that GUI but if you can open a hal watch window you can see what type of number your needing.

JT

Please Log in or Create an account to join the conversation.

More
02 May 2019 00:49 #132472 by microsprintbuilder
yes , I've done that and found a comp called conv-float-u32 to convert the float to u32. It doesn't seem to do the job or I'm implementing it wrong. If I comment out the error line and run and read the hal I can see that it does convert to u32 . but I still get the error that the value ' conv-float-u32-0-out ' is invalid for U32

Please Log in or Create an account to join the conversation.

More
02 May 2019 10:50 #132510 by BigJohnT
No way to guess what the problem is unless we can see the hal line, the input value and the exact error.

linuxcnc.org/docs/devel/html/man/man9/conv_float_u32.9.html

But I'm going to guess anyway that the input value is not in the range of u32. An unsigned 32-bit integer has a usable range of zero to 4,294,967,296.

JT

Please Log in or Create an account to join the conversation.

More
02 May 2019 16:31 - 02 May 2019 16:34 #132546 by microsprintbuilder
So I setp steplen to a value (500) instead of conv-float-u32.0.out and put that same value (500) into the spinbox. I then ran it and pulled up the HAL and looked at the values. steppen.04.steplen is identical to conv-float-u32.0.out .
Attachments:
Last edit: 02 May 2019 16:34 by microsprintbuilder.

Please Log in or Create an account to join the conversation.

More
02 May 2019 23:07 #132572 by BigJohnT
I'm getting the same error as you testing here so I'm assuming you can't set a pin using the output of a function probably because the hal file is read before the thread is run.

JT

Please Log in or Create an account to join the conversation.

More
03 May 2019 01:08 - 03 May 2019 01:08 #132587 by andypugh
Setp takes a numerical value.

It makes no sense to use setp in the way that you are.

All that you need to do is use "net" instead of "setp" and to create a new signal name to link the result.
net signal1 some-pin conv_float_s32.in
net signal2 conv_float_s32.out some-other-pin
Last edit: 03 May 2019 01:08 by andypugh.

Please Log in or Create an account to join the conversation.

More
03 May 2019 14:14 #132634 by microsprintbuilder
So I've tried that and get a error that steplen pin does not exist. Could you give me a example how would you go about connecting a gladevcp spinbox to a spepgen steplen parameter? What I'm trying to do is control the length of the on time on a stepgen to control my mosfet board in my wire edm spark box. And then us velocity to control the frequency in which its happening. The times can be anywhere from 40 milliseconds up. Right now I have a arduino doing that. I'd like to have linuxcnc do it all if possible.

Please Log in or Create an account to join the conversation.

Time to create page: 0.172 seconds
Powered by Kunena Forum