HX711 hal Modul
25 May 2015 22:08 #59014
by andypugh
Yes, unfortunately that is the case. You could have your comp export two functions (like the encoder and stepgen do) with one doing the updating and the other just setting the float output, but that is just as complicated in HAL as using a conv_u32_float component.
Replied by andypugh on topic HX711 hal Modul
But now I need convert u32 to float for using limit3 as input from hx711.
Yes, unfortunately that is the case. You could have your comp export two functions (like the encoder and stepgen do) with one doing the updating and the other just setting the float output, but that is just as complicated in HAL as using a conv_u32_float component.
Please Log in or Create an account to join the conversation.
26 May 2015 16:54 #59065
by fupeama
Replied by fupeama on topic HX711 hal Modul
Yes I understand. You mean something like this....
and hal
Why halcompile allowed me to compile modul with fp operation as assigning a value to float without any warning or error message?
What will happen, if modul is compiled as nofp with fp operation?
Is somewhere described which operation is fp nofp?
Sorry for my stupid questions, I am not programmer but autodidact with poor english.
Thanks Martin
component hx711 "Interface for read HX711";
pin out float output;
.....
.....
function fast nofp;
function slow fp;
.....
....
FUNCTION(fast)
{
nofp operation (int, <<, etc)
}
FUNCTION(slow)
{
output = ........ fp operation (float, double)
}
and hal
....
.....
addf hx711.0.fast base-thread
addf hx711.0.slow servo-thread
.....
......
Why halcompile allowed me to compile modul with fp operation as assigning a value to float without any warning or error message?
What will happen, if modul is compiled as nofp with fp operation?
Is somewhere described which operation is fp nofp?
Sorry for my stupid questions, I am not programmer but autodidact with poor english.
Thanks Martin
Please Log in or Create an account to join the conversation.
26 May 2015 17:34 - 26 May 2015 17:35 #59068
by andypugh
Yes, exactly, though that is just as much extra HAL-effort as adding an int-to-float coversion.
One thing that might make it worthwhile would be to add scale and offset pins so that the output value can be converted to engineering units.
Do you have your work in a git repository, or are you working with an installed system and just writing the comp? The reason I ask is that it would be easier to add your component to LinuxCNC if you could submit it as a git-format patch (which would retain author and signed-off by atribution) but there are other ways to do that if you are not working inside Git.
Replied by andypugh on topic HX711 hal Modul
addf hx711.0.fast base-thread addf hx711.0.slow servo-thread
Yes, exactly, though that is just as much extra HAL-effort as adding an int-to-float coversion.
One thing that might make it worthwhile would be to add scale and offset pins so that the output value can be converted to engineering units.
The halcompile documentation does actually say that it has no way to check for FP operations, so it has no way to warn if they are used in the base thread.Why halcompile allowed me to compile modul with fp operation as assigning a value to float without any warning or error message?
I don't know. Clearly nothing very bad, as the component compiles and works properly. I think that if you were to halscope the function time you would find that there was an increase in execution time every time the output was updated, though I don't know by how much.What will happen, if modul is compiled as nofp with fp operation?
Basically anything which uses a floating point variable or returns a floating-point result.Is somewhere described which operation is fp nofp?
Do you have your work in a git repository, or are you working with an installed system and just writing the comp? The reason I ask is that it would be easier to add your component to LinuxCNC if you could submit it as a git-format patch (which would retain author and signed-off by atribution) but there are other ways to do that if you are not working inside Git.
Last edit: 26 May 2015 17:35 by andypugh.
Please Log in or Create an account to join the conversation.
29 May 2015 16:29 #59183
by fupeama
Replied by fupeama on topic HX711 hal Modul
I work only on instaled system, I have no git repo.
But now I need test this modul more, because the value das not match with real value sometimes. May be noise on wiring.
Unfortunetely there is no control mechanism like a I2c.
I want to write different modul for ADS1115 Super Mini 16 Byte ADC Module Precised Analog Digital Converter with I2c protokol.
Now I am ready to read value from luxmetr BH1750FVI connect on parport, I2c comunication is done but modul is not finished yet.
Martin
But now I need test this modul more, because the value das not match with real value sometimes. May be noise on wiring.
Unfortunetely there is no control mechanism like a I2c.
I want to write different modul for ADS1115 Super Mini 16 Byte ADC Module Precised Analog Digital Converter with I2c protokol.
Now I am ready to read value from luxmetr BH1750FVI connect on parport, I2c comunication is done but modul is not finished yet.
Martin
The following user(s) said Thank You: mehdidadash
Please Log in or Create an account to join the conversation.
- mehdidadash
- Offline
- Senior Member
Less
More
- Posts: 50
- Thank you received: 4
04 Dec 2023 16:12 #287203
by mehdidadash
Replied by mehdidadash on topic HX711 hal Modul
does this work just by connecting it to parallel port and it does not require other boards ?
Please Log in or Create an account to join the conversation.
Time to create page: 0.132 seconds