Jump to content

Recommended Posts

Hi guys,

I am using a HSC to count pulses of a square wave signal, thats comes to my SAMBA (43 J-T20 ) through I0. Therefore I configured the I0 in HWConfigutatione as HSC and it counts very well.
Now I want the HSC counter value to reset , if a vertain event happens. For example if i hit a RESET button on the touchscreen, I want the HSC value to reset to 0.
I tried numeric reset and immidiate Reset HSC but both didnt work so far.

I think the HSC with Reload is a possibility to use the reload as a reset, but i dont have a fix value when the HSC counter should reset. So this reload ability doesnt work for me neither.

Do you have any suggestions?

Thanks!

Link to comment
Share on other sites

5 hours ago, CobryWZL said:

Hi guys,

I am using a HSC to count pulses of a square wave signal, thats comes to my SAMBA (43 J-T20 ) through I0. Therefore I configured the I0 in HWConfigutatione as HSC and it counts very well.
Now I want the HSC counter value to reset , if a vertain event happens. For example if i hit a RESET button on the touchscreen, I want the HSC value to reset to 0.
I tried numeric reset and immidiate Reset HSC but both didnt work so far.

I think the HSC with Reload is a possibility to use the reload as a reset, but i dont have a fix value when the HSC counter should reset. So this reload ability doesnt work for me neither.

Do you have any suggestions?

Thanks!

 

Link to comment
Share on other sites

Depends on what you read with a high-speed counter.

If this is an encoder that rotates with the engine, in your program you can stop the engine at the same time and write 0 to the encoder variable, but the inertia remains and the variable of the high-speed counter changes by a certain number of units even if you set EndSub right after this event

So, probably, if you need 0 in your counter, you need to wait some time after you stop some output, which changes your counter and only after this task store 0 in hsc variable

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.