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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...