Author Topic: Connect to USB Serial Port  (Read 2158 times)

minius

  • Newbie
  • *
  • Posts: 11
Re: Connect to USB Serial Port
« Reply #15 on: August 29, 2016, 07:40:07 AM »
Thank you for the information. I got quite good reading now with a 300 ms delay for reading and no other changes in settings.

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 359
  • Here to help you
Re: Connect to USB Serial Port
« Reply #16 on: August 29, 2016, 09:42:27 AM »
Thank you for the information. I got quite good reading now with a 300 ms delay for reading and no other changes in settings.

Thats great news you got it working and thank you for letting us know.

300mS - seems a huge delay - not what I was expecting but then again I've never used Arduino - at least it works :)
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

minius

  • Newbie
  • *
  • Posts: 11
Re: Connect to USB Serial Port
« Reply #17 on: September 20, 2016, 05:42:20 PM »
I have reduced the delay to 30ms and it still works on it's 4th attempt. Maybe the delay needed is due to the fact that HN 4 is slower in windows (or maybe not).

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 359
  • Here to help you
Re: Connect to USB Serial Port
« Reply #18 on: September 21, 2016, 08:46:42 AM »
I have reduced the delay to 30ms and it still works on it's 4th attempt. Maybe the delay needed is due to the fact that HN 4 is slower in windows (or maybe not).

Not sure if setting Windows process priority from Normal to High might make a difference to serial comms speed.

Perhaps increasing the priority of HyperNext Creator for testing, and then your built app might help but probably only if your and your  customer's computer are busy and not idling.


To test on raising HN Creator 4 priority, make a batch file, called HNC4.bat

and enter the following command similar to match your circumstances:

Code: [Select]
START "HyperNext Creator" /HIGH "C:\Program Files (x86)\HyperNext Studio 4\HyperNextCreator4.exe"
Then run the batch file and HN4 should start up - and the Task Manager should show it as running at HIGH priority.







I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 359
  • Here to help you
Re: Connect to USB Serial Port
« Reply #19 on: September 21, 2016, 01:22:50 PM »
I have reduced the delay to 30ms and it still works on it's 4th attempt. Maybe the delay needed is due to the fact that HN 4 is slower in windows (or maybe not).

Hi Minius

I've just looked at your project and noticed that it isn't reading from the serial port inside the Serial Port Event - available via the Editor - Specials button.

Perhaps you are now using the Serial Port Event, if so thats great, so please disregard the following.

If you don't use the event and instead try to force read data then it would be unreliable.
Using the event means you only get data when it arrives and so should allow greater data throughput.
It means your app could sit idling until data arrives at the port.

The command to use inside the serial port event is something like:-

Code: [Select]
@ used inside SerialMotor project
Put SerialReadAllFN(1) after field 3

Actually the above code is not suitable for higher speed comms because writing to fields is slow and better to write to a variable.


So sorry the docs don't give an example, and although the Serial Motor project shows how to do this,  it again unfortunately it isn't documented.

Malkom
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.