_pic command and unexpected read values
3 years 2 months ago #29534909
by wstuck
_pic command and unexpected read values was created by wstuck
I am using a basic _pic command
PIC - Read Pulse Input after Conversion
Description:
Returns value of a Pulse input after all the adjustments were performed to convert it to a
command or feedback value (Min/Max/Center/Deadband/Linearity). If an input is disabled,
the query returns 0.
Syntax Scripting: result = getvalue(_PIC, cc)
Reply: PIC=nn Type: Signed 16-bit Min: -1000 Max: 1000
Where:
cc = Pulse input number
nn = Converted input value to +/-1000 range
' Read the Pulse Pin1 and Pin2 values
pulse1 = getvalue(_pic,1) 'put pulse ch1 Pin1 in variable
pulse2 = getvalue(_pic,2) 'put pulse ch2 Pin2 in variable
I was expecting to see the same values that I am seeing on the RUN tab of the Roborun+ software in the Pulse In window.
The Pin1 reads 1495 when the system is idle but the _pic,1 value is returning -24 in the Console window as a print value
The Pin2 reads 1523 when the system is idle but the _pic,2 value is returning 990 in the Console window as a print value
See attached images
Is this normal? If so why are the values so different?
PIC - Read Pulse Input after Conversion
Description:
Returns value of a Pulse input after all the adjustments were performed to convert it to a
command or feedback value (Min/Max/Center/Deadband/Linearity). If an input is disabled,
the query returns 0.
Syntax Scripting: result = getvalue(_PIC, cc)
Reply: PIC=nn Type: Signed 16-bit Min: -1000 Max: 1000
Where:
cc = Pulse input number
nn = Converted input value to +/-1000 range
' Read the Pulse Pin1 and Pin2 values
pulse1 = getvalue(_pic,1) 'put pulse ch1 Pin1 in variable
pulse2 = getvalue(_pic,2) 'put pulse ch2 Pin2 in variable
I was expecting to see the same values that I am seeing on the RUN tab of the Roborun+ software in the Pulse In window.
The Pin1 reads 1495 when the system is idle but the _pic,1 value is returning -24 in the Console window as a print value
The Pin2 reads 1523 when the system is idle but the _pic,2 value is returning 990 in the Console window as a print value
See attached images
Is this normal? If so why are the values so different?
Please Log in or Create an account to join the conversation.
3 years 2 months ago - 3 years 2 months ago #29534910
by wstuck
Replied by wstuck on topic _pic command and unexpected read values
I found that the command that i should be using is _pi and not _pic.
' Read the Pulse Pin1 and Pin2 values
pulse1 = getvalue(_pi,1) 'put pulse ch1 Pin1 in variable
pulse2 = getvalue(_pi,2) 'put pulse ch2 Pin2 in variable
' ***
The _pi command returned the same value that you see in the RUN tab at the PULSE IN values for Pin1 and Pin2 (Default RC channels).
' Read the Pulse Pin1 and Pin2 values
pulse1 = getvalue(_pi,1) 'put pulse ch1 Pin1 in variable
pulse2 = getvalue(_pi,2) 'put pulse ch2 Pin2 in variable
' ***
The _pi command returned the same value that you see in the RUN tab at the PULSE IN values for Pin1 and Pin2 (Default RC channels).
Please Log in or Create an account to join the conversation.
Time to create page: 0.056 seconds