hw 2 make type covertions floating point to bit
- sakthi
- Topic Author
- Visitor
04 May 2010 06:33 #2794
by sakthi
hw 2 make type covertions floating point to bit was created by sakthi
Hi
i have generated square pulse but it was a floating point value when i try to link this one to parallel port
pin i got following errors also i given my code can any one know about this problem.
root@fedlabs-desktop:~/Desktop/pulse# halrun -I softstart.hal
softstart.hal:14: Type mismatch on pin 'parport.0.pin-02-out'
halcmd: exit
##############################
loadrt threads period1=100000 name1=base-thread name2=slow period2=1000000
loadrt stepgen step_type=0 ctrl_type=v
loadrt siggen
loadrt probe_parport
loadrt hal_parport cfg="0x378"
addf parport.0.read slow
addf parport.0.write slow
addf siggen.0.update slow
addf stepgen.update-freq slow
addf stepgen.make-pulses base-thread
net X-vel <= siggen.0.square
net X-vel => stepgen.0.velocity-cmd
net X-vel => parport.0.pin-02-out
setp siggen.0.amplitude 5
setp stepgen.0.position-scale 10000
setp stepgen.0.enable 1
start
loadusr halscope
##############################
i have generated square pulse but it was a floating point value when i try to link this one to parallel port
pin i got following errors also i given my code can any one know about this problem.
root@fedlabs-desktop:~/Desktop/pulse# halrun -I softstart.hal
softstart.hal:14: Type mismatch on pin 'parport.0.pin-02-out'
halcmd: exit
##############################
loadrt threads period1=100000 name1=base-thread name2=slow period2=1000000
loadrt stepgen step_type=0 ctrl_type=v
loadrt siggen
loadrt probe_parport
loadrt hal_parport cfg="0x378"
addf parport.0.read slow
addf parport.0.write slow
addf siggen.0.update slow
addf stepgen.update-freq slow
addf stepgen.make-pulses base-thread
net X-vel <= siggen.0.square
net X-vel => stepgen.0.velocity-cmd
net X-vel => parport.0.pin-02-out
setp siggen.0.amplitude 5
setp stepgen.0.position-scale 10000
setp stepgen.0.enable 1
start
loadusr halscope
##############################
Please Log in or Create an account to join the conversation.
04 May 2010 11:37 #2798
by BigJohnT
Replied by BigJohnT on topic Re:hw 2 make type covertions floating point to bit
Scroll down to the realtime components and you can see all the converters they start with conv_
www.linuxcnc.org/docview/html/
You might also want to read this chapter in the Integrators Manual.
www.linuxcnc.org/docview/html//hal_basic_hal.html
John
www.linuxcnc.org/docview/html/
You might also want to read this chapter in the Integrators Manual.
www.linuxcnc.org/docview/html//hal_basic_hal.html
John
Please Log in or Create an account to join the conversation.
07 May 2010 11:31 #2817
by andypugh
Replied by andypugh on topic Re:hw 2 make type covertions floating point to bit
BigJohnT wrote:
I think that float to bit is a 2-stage conversion, which is a bit long-winded. (conv_float_u32 then conv_u32_bit)
An alternative is to use "comp" (window comparator) which will convert float to bit in one step.
I am not sure what you are trying to do, but there are a number of other HAL functions that output usable square waves in bit format which might do what you want. Look at a velocity-mode stepgen, a 50% duty cycle pwmgen signal, a sim-encoder with only one output wired and possibly others.
The full list of available functions is near the bottom of this page:
linuxcnc.org/docs/2.4/html/
Scroll down to the realtime components and you can see all the converters they start with conv_
I think that float to bit is a 2-stage conversion, which is a bit long-winded. (conv_float_u32 then conv_u32_bit)
An alternative is to use "comp" (window comparator) which will convert float to bit in one step.
I am not sure what you are trying to do, but there are a number of other HAL functions that output usable square waves in bit format which might do what you want. Look at a velocity-mode stepgen, a 50% duty cycle pwmgen signal, a sim-encoder with only one output wired and possibly others.
The full list of available functions is near the bottom of this page:
linuxcnc.org/docs/2.4/html/
Please Log in or Create an account to join the conversation.
Time to create page: 0.066 seconds