05-12-2023 10:51 PM - edited 05-12-2023 11:31 PM
Hello everyone,
I am using LabVIEW2023 through the LINX library to control an Arduino Uno. I tested the connection using the LINX example programs "Blink (Simple).vi" and "Blink (Advanced).vi" and they work just fine. I tried to modify the programs so that the LED would blink a user-controllable amount of times. When I tried to run my program, it gives an Error - 54 and a description "Error 54 occurred at TCP Open Connection in LMH-LINX.lvlib:Device.lvlib:TCP Open.vi->LMH-LINX.lvlib:Device.lvlib:Initialize Device.vi->LMH-LINX.lvlib:Initialize.vi->LMH-LINX.lvlib:Open Serial.vi->PrototypeOfControlledLEDBlink.vi", I have linked an image below of the error cluster details.
If I click continue, the program continues to run and starts to blink the LED but it is always blinked an incorrect amount. For example, I input blink 5 times and it'll blink 3 times, input 6 blinks 3, and input 10 blinks 5. For the most part, I am more worried about the error I get when starting the program as this vi will eventually be a subvi for a more complex project.
From my understanding, I am not using the TCP/IP option of the LINX openserial sub vi, yet it still says the TCP address is not configured correctly. For the most part, all I did to modify the example program was to change the while loop from only ending on an "end" button push to ending either when the "end" button is clicked or the while loop has repeated the user-defined amount of times. I didn't touch the serial port LINX sub vi's yet the LINX openserial sub vi now gives me issues. I tested the example programs again to see if they still worked and they did. I couldn't find any information about an Error - 54 on the LINX forums nor online while relating to using LINX.
I've shared an image of the error popup, my edited program, and the two LINX examples that I used to test. I used the Blink (Advanced).vi to build upon.
Thank you for your time and patience.
05-13-2023 09:25 AM
Your description of the "Blink count" error suggests you and your program disagree on the definition of a "Blink". (I'm guessing, here). You seem to define a Blink as the sequence "LED On, LED Off" (or, possibly, "LED Off, LED On"), while your LabVIEW Program defines "Blink" as the sum of "LED On" and "LED Off". If this is, in fact, the case, the solution is simple -- change your LabVIEW code to count what you consider a Blink (I'd recommend defining a Blink as "turning the LED from On to Off").
Bob Schor
05-13-2023 06:19 PM
Would you save your code as previous version?
For error 54, make sure the serial port is not blank or N/A.
05-14-2023 05:43 PM
Thanks for the response, I've now understood that the issue of the LED blinking an incorrect amount of times is due to the number of actions required to blink it. Rather than my mistake of considering each while loop as a complete blink. I should've added a debug counter to the loop to check how many times it looped and compare that visually to the LED.
05-14-2023 05:47 PM
@GRCK5000
Thank you for responding, I'm not sure what you mean by saving the code as a previous version and I've stepped through the code to the serial subVI to make sure the serial port selection was not empty or N/A. The user serial input selector does correctly detect that the device is available and you can select it as your choice. But, when running the code it throws the error 54. Which from my understanding of Error 54 has nothing to do with me using serial.
05-14-2023 09:18 PM - edited 05-14-2023 09:20 PM
Hi,
How are you?
I'm assuming you are using LabVIEW 2023. Some of us don't have 2023. So if you save for previous version as shown below, it will allow us to open your code. Otherwise, we won't be able to open your code.
05-16-2023 01:36 AM
Hello,
Here is my program as a Labview 19 version and another as Labview version 21.
05-16-2023 02:58 AM - edited 05-16-2023 03:00 AM
Hi Apple,
@TheAppleWhoFell wrote:
Here is my program as a Labview 19 version and another as Labview version 21.
Well, it would help to name the files so we can differ the version before downloading the VI…
Your VI after some cleanup:
05-16-2023 03:38 PM
Hello GerdW,
Thank you for taking the time to check my program. I am as confused as you are about why there is a second while loop, especially because it is hidden behind another while loop. Once I get the chance I'll clean up my program and remove that second loop. Did you find the while loop underneath by moving the above while loop or did you use a different method?
Again, thank you for your time,
Apple
05-17-2023 12:30 AM
Hi Apple,
@TheAppleWhoFell wrote:
Did you find the while loop underneath by moving the above while loop or did you use a different method?
I mentioned the AutoCleanup tool previously, did I?