A simple com sender

Discuss PC Developer and Web Developer projects and features here.
User avatar
Nico595
Posts: 76
http://meble-kuchenne.info.pl
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Flowcode v10 A simple com sender

Post by Nico595 »

Hello,

I try send string from PC to the device with PC App USB example. It's my first job with PC App.
I removed all about the receive buffer because the first step for me is send data.

I have two string: "dU" to up the level and "dT" to down the level of the device. Work fine with HyperTerm but nothing with PC App.

My Windows port com is Com Serial to USB (COM17) named AT91 to serial, my USB Serial driver.
App_Comm_Test1.jpg
App_Comm_Test1.jpg (67.65 KiB) Viewed 11985 times
App_Comm_Test2.jpg
App_Comm_Test2.jpg (68.43 KiB) Viewed 11985 times


Thank you for your advice.

stefan.erni
Valued Contributor
Posts: 997
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 190 times
Been thanked: 217 times

Re: A simple com sender

Post by stefan.erni »

Hi Nico

Can you ad this " \r\n" = CR + LF → Used as a new line character in Windows


"dU" replace with "dU\r\n "


or post Your App?

regards


Stefan

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: A simple com sender

Post by Nico595 »

Hi Stefan,

Thank you so much for your answer :)

I try this now.

I hope the Com Port VID and PID is not locked by Flowcode.

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: A simple com sender

Post by Nico595 »

No result with new line character. I have only a new line in the console.

I can connect HyperTerm to my device without problem and send this string. Work fine with a simple com terminal software.
I don't understand why the string is not sent in the com by the Flowcode Pc App.

Of course if the VID and PID are filtered by Flowcode, I can't use my AT91 driver.
PC Dev Uno 3ch temp logger_test1.fcsx
(45.84 KiB) Downloaded 282 times

stefan.erni
Valued Contributor
Posts: 997
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 190 times
Been thanked: 217 times

Re: A simple com sender

Post by stefan.erni »

Hi Nico

I changed the commands to my hardware, choosed to comport4
and pressed the button. my recorder started and stopped after 9sec.
So Your APP is working.
Maybe a config problem from the comport Nr ?
2024-09-26_12-56-58.PNG
2024-09-26_12-56-58.PNG (2.5 KiB) Viewed 11949 times
2024-09-26_12-56-29.PNG
2024-09-26_12-56-29.PNG (23.89 KiB) Viewed 11949 times
2024-09-26_12-54-25.PNG
2024-09-26_12-54-25.PNG (71.45 KiB) Viewed 11949 times

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: A simple com sender

Post by Nico595 »

Thank you Stefan,

I think the Flowcode App is locked with the USB driver, we can't drive other devices and other card of those defined by Flowcode.

If a member of the Flowcode Team can confirm it ?

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: A simple com sender

Post by Nico595 »

I connected the logic analyser on the UART. I send all packets from the USB rx to the UART tx.

It's very strange, I receive data but no good.

Nothing with the SendByte macro of the com port component.
The last string with the SendString macro of the com port component.
And some bit with the SendBinary macro of the com port component.

When I test after that with the HyperTerm, I receive perfectly all data. So it's a problem from the PC App.

I hungry, I will eat now ^^.

BenR
Matrix Staff
Posts: 1924
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 684 times

Re: A simple com sender

Post by BenR »

Hello,

Flowcode doesn't create any kind of lock on VID/PID etc and should work with just about anything. I'm wondering if 3s is enough for the BT pairing to be established reliably. Could you instead have a button to connect, then another button to do the data send and then a third button to disconnect. This way you can connect and then keep trying to send data and then disconnect once the process has been done.

Steve-Matrix
Matrix Staff
Posts: 1465
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 204 times
Been thanked: 347 times

Re: A simple com sender

Post by Steve-Matrix »

A few other thoughts.

There are sometimes issues when a COM port greater than 9 is accessed. You should be able to change the COM port used by your device to a lower one to see if that fixes the issue.

And have you looked at the "Serial Comms Worked Example - PC Developer" on the App Developer sample projects page? This is a very basic example, but might be a good starting point for testing your hardware.

User avatar
Nico595
Posts: 76
Joined: Tue Jul 04, 2023 4:17 pm
Has thanked: 16 times
Been thanked: 3 times

Re: A simple com sender

Post by Nico595 »

Thank you for your answer Ben. I will try with 3 buttons, Connect step, Send string and Disconnect.

Hi Steve, Thank you for this information. I have com port 17 on the Lanner and com port 8 on the Shuttle with FC10. It's not simple on the Lanner because I have not FC10, it's my old machine with FC5. But if the number of the com port can be a problem, I will work on the Shuttle. However I have the same packets with the Shuttle on the com port 8.

I will continue to investigate

Post Reply