PDA

View Full Version : SIOC RMP1 with one rotary encoder and push button



Niklas
02-06-2017, 02:06 PM
Hello,

does anyone know if there is a possibility to switch between MHz and kHz with a rotary encoder?
I do not want to waste inputs with more encoders.

Thanks.

kiek
02-06-2017, 02:46 PM
Yes you can with a SIOC script. On the push of the button you switch between MHz and KHz and back.

Niklas
02-06-2017, 03:44 PM
Do you have a code example?
I tried the following that do not work:
(pseudocode)
Var1 Input_SW type P
if Var1 = 0
MHz
else kHz

That is not the solution

kiek
02-06-2017, 04:00 PM
Here a script for a similar problem (http://www.lekseecon.nl/howto.html#ROTPush).
It should not be too difficult to change it to your requirements....

Niklas
02-07-2017, 01:34 PM
Thanks for that.

Now the problem is that I just can turn it in both direction but unfortunatly it increses both times. Since the website says it should not I am confused.



Var 0370, name Wechsler, Link IOCARD_SW, Input 274, Type P


Var 0372, name COM1, Link IOCARD_ENCODER, Input 275, Aceleration 0, Type 2
{
L0 = &COM1
IF &Wechsler = 0
{
L0 = L0 * 25
&RMP1kHz = ROTATE 0 ,995 ,L0
}
ELSE
{
&RMP1MHz = ROTATE 18 ,36 ,L0
}
}



In addition, it increases only by 5. But this amy come from JL?

kiek
02-08-2017, 04:28 AM
Make sure that:* you are you using a Grey Type Rotary Encoder.* you are using two consecutive logical inputs of which 275 is the lowest number.and change Aceleration into 1.

Niklas
02-08-2017, 06:06 AM
Hi. I am using the same encoder as for example HDG and SPD. And there it works(ok there I do not have to modify the code).
I will check acc 1.

Niklas
02-08-2017, 10:19 AM
Acc 1 does not work. The encoder works as the following:

Rotate clockwise: 1) 275 on 276 off
2) 275 on 276 on
3) 275 off 276 on
4) both off

kiek
02-08-2017, 11:02 AM
Aceleration 1 only means that you will get the same increment/decrement when you turn the encoder slowly or fast...

Niklas
02-08-2017, 11:32 AM
Okay. But in both ways it do not work.
So my questions are: Why does it only increase by 5? (*25 is set)
And why does it only increase?
Is the a possibility to "see" the direction?

Thanks.
Niklas

kiek
02-08-2017, 01:51 PM
Good questions, I am not familiar with JeeHell.You can monitor var 372 in the IOCPConsole.exe program, check if you get negative values when turning in one direction and positive values when turning in the other direction....

Niklas
02-10-2017, 11:45 AM
This is the result: ( I turned more than two times!).

372=-1 - COM1
14=592 - RMP1kHz
372=0 - COM1
372=1 - COM1
14=568 - RMP1kHz
372=0 - COM1
372=1 - COM1
14=544 - RMP1kHz
372=0 - COM1
372=-1 - COM1
14=518 - RMP1kHz
372=0 - COM1
372=1 - COM1
14=494 - RMP1kHz
372=0 - COM1

To my mind I think that this is a JL problem? Isint it?

Niklas
02-16-2017, 08:58 AM
I have a new result with all var.:

372=-1 - COM1
14=133 - RMP1kHz
372=0 - COM1
16=128130 - RMP1Stby_disp
372=1 - COM1
14=108 - RMP1kHz
372=0 - COM1
16=128135 - RMP1Stby_disp
372=-1 - COM1
14=133 - RMP1kHz
372=0 - COM1
16=128140 - RMP1Stby_disp

In my oppinion this is a JL bug, isnt it?
Anyone who can use it with SIOC?
Regards,
Niklas

Niklas
02-19-2017, 02:21 AM
Is there no one using RMP with SIOC?