Asked
Hello @Athena, I have the latest update to ARC(12/21). I'm having trouble with one of my scripts that previously worked. Attached is a snippet of the code:
EZB4:
var pathTotalDistance = 2440;
UART.initHardwareUart(0, 9600, 0);
// Send the variables to Arduino
var highByte = (pathTotalDistance >> 8) & 0xFF;
var lowByte = pathTotalDistance & 0xFF;
UART.hardwareUartWrite(0, [highByte, lowByte]);
print("Sending pathTotalDistance high byte: " + (pathTotalDistance >> 8));
print("Sending pathTotalDistance low byte: " + (pathTotalDistance & 0xFF));
I get the following error:
Execution Error Line 17 Col 0 - No public methods with the specified arguments were found.
Can you please review my code for errors? Could my "execution error" be related to the latest ARC update? Thanks Jack
Hello Jack,
Let's take a closer look at your code snippet and the error message you're encountering. The error message indicates that there might be an issue with the arguments you're passing to the
UART.hardwareUartWrite()
function. Let's break down the code and see if we can identify the problem.Code Review
Variable Initialization:
UART Initialization:
High and Low Byte Calculation:
UART Write:
Print Statements:
Potential Issues
Bitwise Operations:
>>
is used to get the high byte, and the bitwise AND&
is used to mask the byte.UART Write Function:
UART.hardwareUartWrite()
function should be called with the correct parameters. Ensure that theuartIndex
andezbIndex
are correctly specified.Suggestions
Check the UART Initialization:
uartIndex
andezbIndex
are correct. In your case, both are set to0
, which should be fine if that's your intended configuration.Verify the Bitwise Operations:
>> 8
to shift the bits, and both high and low bytes should be masked with& 0xFF
.Review the Error Message:
UART.hardwareUartWrite()
function to ensure it accepts the parameters you're providing.Updated Code
Here's a slightly revised version of your code with comments for clarity:
If the issue persists, please double-check the UART configuration and ensure that the
UART.hardwareUartWrite()
function is being used correctly. If you have any further questions or need additional assistance, feel free to ask!I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Hello @Athena, I still get the error message on the 'UART.hardwareUartWrite ' statement. I've checked my connections from the EZB4 to the Arduino and all is good. It worked prior to the final update. Could you please verify that Uart still works with the last update to ARC? Thanks Jack
Hello Jack,
I understand your concern, and I'm here to help. Let's verify a few things to ensure that the UART functionality is working correctly with the latest ARC update.
Steps to Verify UART Functionality
Check ARC Version:
Review UART Initialization:
UART.initHardwareUart()
function. Ensure that theuartIndex
andezbIndex
are set correctly.Test UART with Simple Data:
Check for Known Issues:
Review Error Message:
UART.hardwareUartWrite()
function is called with the correct parameters.Test with Different Data Types:
Additional Debugging
Print Debugging:
Check EZB Connection:
If the issue continues, it might be helpful to reach out to Synthiam support directly for further assistance. They can provide more detailed insights into any changes in the latest update that might affect UART functionality.
Feel free to ask if you have any more questions or need further assistance!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
There isn't 17 lines in your program - so you're not getting that error where you think it is. Either you're not posting the entire code, or you're posting the error message from a different script. What you have posted works totally fine..
That works fine. There are no issues with it. It works as expected. There are only 10 lines in that code, and the error you posted is for line 17.
Also, to clarify things for Athena - the code you are posting is JavaScript, not EZBv4. There is no such thing as an "EZBv4" programming language. You will get better results from Athena if you refer to the programming language using its correct name. Calling it JavaScript will help Athena and others understand what your code is.
Hello @Synthiam Support and @DJ, I know its Sunday evening, forgive me, I can wait until normal working hours for this. I am having trouble with UART.hardwareUartWrite command. My EZB4 script is communicating with an Arduino via UART and it has been working flawlessly sending several commands back and forth for my project. Today when I opened up my project, I downloaded ARC 12/21 and now I get an error from the UART write statement. As you can see, Athena has done her best to help me. Can you please check the latest revision on your end and try to run the following code? Thank you for your help. Jack
Please use this thread. Scroll up for my response - Athena can't help you because the code you posted works fine. See my previous response, I think you posted the wrong code, not all the code, or the error is from a difference code.
Thank you DJ. The line 17 was the actual code in my script for the uart write statement. I should have deleted that notation in my code snippet of JavaScript. I downloaded a separate time the latest ARC rev and the code runs fine now. When I last logged in and it performed the auto download I must have gotten some bad data ( probably warming up my hot chocolate in the microwave):) thank you again and good night. Jack