10/24/2011 9:07 AM | |
Joined: 4/22/2010 Last visit: 5/3/2024 Posts: 5697 Rating:
|
Hello, Attachmenthsc_02_05_07.zip (256 Downloads) |
Problem solved? |
|
10/25/2011 12:42 PM | |
Posts: 5225 Rating:
|
Hi there, What you want to do when you start is to load the -675 into the high speed counter's counter value. That is the start value to work from. Let me explain deeper. Initialy when you work with the HSC you need to tell it how it is going to work. For that the instruction wizard works well. If you want to change the count direction, count value (CV) or prest value (PV) then you need to tell the HSC so. The steps are.. 1] prepare to tell the HSC what you want -- through a special marker associated with your HSC 2] prepare the buffer values (CV or PV) -- though a special marker associated with your HSC 3] tell the HSC to execute the process. Please see the attached Excel sheet that contains a picture showing the code you require to make your HSC start from -675. Remember that the CV is the current value for the HSC. In the Excel sheet you can also change the control byte so that you can change the PV value. Changing the PV change the target for the interrupt that triggers when target (PV) = count value (CV). With all this in mind, please reread the help file. Aas a last note - if you wish to know what high speed counter number 1 is doing, simply read the absolute address (of double word format) named "HC1". Hope this helps. --William Attachmenthigh speed counter setup calculator.zip (222 Downloads) |
10/25/2011 1:27 PM | |
Joined: 4/22/2010 Last visit: 5/3/2024 Posts: 5697 Rating:
|
Hello, In my program, i load vd900 (offset in pulses) in VD200 (sbr 11 ) if you put there your calculated value mm to pulses with a negative value the counter will start at that value after reset counter. In fact all you have to do is put your value in pulses in SMD58 and call HSC_INIT . Attached example will demonstrate it. Regards, Marcjan AttachmentHSC_example.zip (220 Downloads) |
Problem solved? |
|
Follow us on