Timer

More
28 Jul 2011 22:12 #11973 by BigJohnT
Replied by BigJohnT on topic Re:Timer
piasdom wrote:

BigJohnT wrote:

The components and2 and or2 are logic gates. Each one takes two inputs and has one output...
and2 works like this:
if input0 AND input1 is on then the output is on.


if either one is off, out is off ?


Yep

or2 works like this:
if input0 OR input1 is on then the output is on.
John


this i get lost, as i understand this. if either is ON,
then out is ON. but at least ONE will be on at all times.
so it would stay ON ? and ya'll talk about input/output,
i don't see(mentally) what's going "which" way when i press
the button. i understand when i click the button it will turn on
or off. but this wiring(logic) gets me. but i'll keep fighten :)
Thanks !!!!!!


That is also correct with the or2 if either input is on then the output is on.

Each component will have pins that you can connect appropriate things to. In the case of the or2 component you have three pins

or2.n.in0
or2.n.in1
or2.n.out

so you have two inputs and one output... if you have the output from a pyvcp button connected to or2.n.in0 and press the button the or2.out will be on as long as one of the in's are on.

John

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

More
29 Jul 2011 11:42 - 29 Jul 2011 13:28 #11985 by piasdom
Replied by piasdom on topic Re:Timer
Thanks Andy and John !


net reset-m123 or2.1.in0 == pyvcp.reset-m123
net m123-reset or2.1.out == halui.mdi-command-05


guess not. get error message that i can't change modes
while program is running if i click reset.BB

kenneth
Last edit: 29 Jul 2011 13:28 by piasdom.

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

More
08 Aug 2011 11:26 - 08 Aug 2011 11:50 #12297 by piasdom
Replied by piasdom on topic Re:Timer
when the counter script(m123) gets to g43 h4, it resets to zero.
is this suppose to work like this? i'm using m123 to increase the count
and m124 to reset to zero.

File Attachment:

File Name: nothing.ngc
File Size:0 KB


script -
#!/bin/bash
COUNT=$(halcmd getp pyvcp.count)
let "COUNT += 1"
halcmd setp pyvcp.count $COUNT
exit 0

Thanks
kenneth
Attachments:
Last edit: 08 Aug 2011 11:50 by piasdom.

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

More
08 Aug 2011 12:01 #12298 by andypugh
Replied by andypugh on topic Re:Timer
is there a reset in <ngcsub> which is called but not part of that file?

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

More
08 Aug 2011 12:17 #12299 by piasdom
Replied by piasdom on topic Re:Timer
oops.......Thanks
it does

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

More
23 Sep 2011 12:19 - 23 Sep 2011 12:23 #13389 by piasdom
Replied by piasdom on topic Re:Timer
is there a button,label or something to be able
to use the below in glade?

loadrt time count=2
addf time.0 servo-thread



Thanks
kenneth
Last edit: 23 Sep 2011 12:23 by piasdom.

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

More
23 Sep 2011 16:30 #13397 by piasdom
Replied by piasdom on topic Re:Timer
i tried hal label with u32 as in xml. can someone at least
tell me if this is possible "AT ALL", so i can stop beating my head :)



Thanks
kenneth

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

More
23 Sep 2011 16:58 #13398 by andypugh
Replied by andypugh on topic Re:Timer
I am not sure I really understand your question, but the "time" component does have three u32 outputs. You should be able to connect those to Glade
According to www.linuxcnc.org/docview/devel/html/gui/...l#gladevcp:HAL_Label
You would need to set the type to 2 and choose a suitable format specifier. For time values I would try "%02i" I think.
Python format strings are a subject all of their own:
docs.python.org/release/2.5.2/lib/typesseq-strings.html (which I feel could be more clearly written)

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

More
23 Sep 2011 17:17 - 23 Sep 2011 17:21 #13399 by piasdom
Replied by piasdom on topic Re:Timer
Thanks andypugh ,
i had time in pyvcp and know about the u32. i do have the label
in glade set to u32. and have the pin/signal linked in my post hal to
time.0.hours. but it says pin(gladevcp.Time_hour) doesn't exist.
and i have text set %2.0f. Will keep looking.


Thanks
kenneth

net power-hours time.0.hours == gladevcp.Time_hour
Last edit: 23 Sep 2011 17:21 by piasdom.

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

More
23 Sep 2011 17:38 #13400 by andypugh
Replied by andypugh on topic Re:Timer
Put the words "show pin" right at the start of your postgui HAL file. That will list all the pins that exist at that point into dmesg.
Then you can see what the Glade pins are really called.

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

Time to create page: 0.184 seconds
Powered by Kunena Forum