Asked — Edited
Resolved Resolved by DJ Sures!

Error On Line 25: Missing String Quotes

I'm getting an error message in one of my scripts that is giving me some trouble. It's a random error meaning that it will happen every few times the command is run. It's set in a loop so it will repeat. Sometimes it will even cause the connection between the EZB and computer to cut off. Here'e the error:


Error on line 25: Missing String Quotes or Invalid Expression at index 14: "

and


Error on line 25: Missing String Quotes or Invalid Expression at index 15: "

Here's the script to happens in. Seems to center around the print commands. Once I removed the print command at line 25 and the error skipped to the next one. I've also expanded the sleep() commands thinking it was running too fast but it does not help. Thanks for looking :


# This Script will return the actual position number of the left catrrage
# #from the Kangaroo withough the 1,p in the begining.
# #Returning feedback with the 1,p causes problems.
# #Do Not Delete. Other scripts depend on this script!

# -------------------------------------
# Get Roo position

uartWrite(2, 2, "2, Getp", 0x0d)

:waitForData
Sleep(30)

$y_lft = UartAvailable(2, 2)
Sleep(30)
print("Bytes in buffer:" + $y_lft)

if ($y_lft < 6)
  # Go back and wait for data again because we did not receive the least number of expected bytes.
  goto(waitForData)
endif
Sleep(30)
$Get_Lft_Carrage_P = UARTRead(2, 2, $y_lft)
Sleep(30)
print("Received: " + $Get_Lft_Carrage_P)

Sleep( 50 )

# -------------------------------
# Find out and print if the P is upper or lower case.
# Upper case means motor has finished move ans stoped.
# Lower Case means that motor is still moving.

$P_lft_or_p_lft = GetCharAt($Get_Lft_Carrage_P, 2) #Assign a variable to either a capitol P or Small case p returned by Kangaroo.

Print("P_lft_or_p_lft:" + $P_lft_or_p_lft)

# -----------------------------
# Defeat the P_lft_or_p_lft

if ($P_lft_or_p_lft = "p")
  Goto(Lower_p_Split)
ELSEif ($P_lft_or_p_lft = "P")
  Goto(Upper_P_Split)
endif

Sleep( 50 )

:Lower_p_Split

$Lft_Carrage_Position = Split($Get_Lft_Carrage_P, "p",1) #1,pXXXX is returned. Get everything after the Lower case p (P is case senceitive).
Sleep(30)
print("Received:" + $Lft_Carrage_Position)
Halt()

:Upper_P_Split
$Lft_Carrage_Position = Split($Get_Lft_Carrage_P, "P",1) #1,pXXXX is returned. Get everything after the Upper case P (P is case senceitive).
Sleep(30)
print("Received:" + $Lft_Carrage_Position)


ARC Pro

Upgrade to ARC Pro

Unlock the true power of automation and robotics by becoming a proud subscriber of Synthiam ARC Pro.

#9  

Really nothing to contribute to this thread except DJ really kicks axx. I don't personally use a kangaroo but it seems he's on a plug in making/fixing rampage!

#10  

Oh My! Either your a really cool helpful, thoughtful CEO or your just getting tired of my whining. ;) Either way, you rock DJ.

The Kangaroo x2 operates as a daughter board for the Sabertooth. Any of the Sabertooth models will operate with the Kangaroo except the Sabertooth 2X5 (It will work also but you need to change some settings inside the 2X5 first). The Roo gives any of the Sabertooth's speed and position control.

Also for the roo to run and do it's Autotune it must be attached to a motor and have a feedback device like an encoder. All parts of the circuit must be in place and working properly before the Roo will complete a successful autotune. Once completed the Sabertooth/Roo combo useually runs really smooth and is very solid.

I'll gladly buy the parts you need and have them sent to your workshop. I actually have a new Kangaroo and a Sabertooth 2x12 here that I can get in the mail to you as soon as tomorrow. Just let me know where to mail them to.

Thanks again!:)

PRO
Synthiam
#11  

Okay, mail it and that'll work good. I have the USB driver for will to complete testing and then I'll do your plugin.

#12  

Outstanding!

Will! That guy? I'm sure he wouldn't mind stepping aside and letting you do mine first.... LOL. Just kidding. Will's project is an important one and I'm sure he'll be needing your plugin asap. I'll gladly wait.;)

Do I mail it to this address?:

EZ-Robot Inc. #10 6120 11 Street SE Calgary, Alberta T2H 2L7

If not please send me your shipping address.

Many thanks!

PRO
Synthiam
#13  

Yup, that's the correct address!

#14  

Thanks again DJ, I'll get the package with a Sabertooth 2x12 and a Kangaroo X2 out on FedEx later today or tomorrow. I know your working on Will's project so there doesn't seem to be a huge rush to get this to you. Either way it should arrive next week. I'll mark it to your attention.

In the meantime I'm going to keep working on this issue to see if I can learn something. Afterall, that's what life is all about isn't it?

I think I made a little progress last night. I think I found a couple underlying issues that may have been causing the EZB to disconnect. After making a few script timing adjustments I was able to run the arms several times without disconnecting the EZB. I still need to clean things up in the scripts a little and do some more testing to make sure. I think what was happening was I was sending commands through the same Uart port to both channels of the Kangaroo to fast or at the same time. I have one Kangaroo X2/Sabertooth controlling both arms through the one Uart port of the EZB. The one Roo/Sabertooth combo can control both of the DC Elbow motors, one in each arm. The combo has two channels, one for each of the two motors. I've found in the past that almost 100% of any issue with my EZB disconnecting or locking up happens when I screw up a command involving a Uart port. Mostly this happens if I try to send a command through it that is not correct or if that Uart port hasn't been initialized yet.

I'm still getting the error in my OP and it still seems to be random. However now it's not disconnecting the EZB and I don't think it was the cause in the first place. This script now just loops and seems to moves past the error until it gets a good read. Again, I'm not sure and I'll need to do a little more testing.

I think what @DJ is saying when he's talking about a binary operation and the variables storing info differently than before is that the characters I'm trying to store in the variables can't be understood? In this case will it work better if I just start using the characters that the script commands are looking for instead of using variables to keep the errors from happening? Am I totally off here? I know the characters that will work are the ones located on a keyboard. With that in mind the returned position of the motor in the Uart buffer from the Kangaroo looks like this when the move is still in progress:


1,p815 (the 1 is the channel the motor is on, the comma is just a comma, the lower case p tells me the move is still going on and the last numbers are the actual position relative the start and end position. in my case my length of travel is zero to 830.


When the move is complete the lower case p changes to an upper case P:
1,P815

The changing "P" really complicates my effort to write a script. If I have a simple script looking for a lower case p and it changes to the upper case P the script will fail or just keep looping. tired What fun! ;)

So the process of learning how to use this wonderful technology keeps going. What a cool journey. :) I'm always open to guidance. Feel free to educate me or point me to resources that will help. :)

PRO
USA
#15  

I think there was a typo or confusion there Dave. Not sure what DJ was saying about USB drive but "will" was not "Will" ;)

PRO
Synthiam
#16  

USB connection for Will (fxrtst)