Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: COM Port  (Read 7535 times)
Marco P.
Posts: 8


« on: June 30, 2011, 10:58:05 am »

Hello,
which is the best way to send command or message to a COM Port on the local PC?

Thanks a lot.
Marco Perissinotto
.
Four Js
Posts: 115


« Reply #1 on: July 01, 2011, 11:17:21 am »

Marco,

by "local PC", do you mean the PC where the front end runs or where the runtime runs ?

Anyway, in both case there is nothing out of the box available. You will need to use 3rd party components (or write your own).

On the runtime side, you may either write your own C extension or have a look at the Java API if there is nothing that could fit your needs.

On the front-end side:
- if you're running GDC, you can write your C++ DLL Extension - you can for instance use http://gitorious.org/inbiza-labs/qserialport to do it in Qt to speak the same language as GDC. This would be the cleanest solution. You could use a separate executable, redirect output to a file and get the file via file transfer, but this would not be my preferred way.

- if you're running GWC, I'm afraid the browser limitations are too high for that (except if you're running IE and use GFXAC, so you can use the same DLL as the GDC one, but the scope is very limited).

Hope this helps,
Regards,
Pierre-Nicolas
Reuben B.
Four Js
Posts: 1047


« Reply #2 on: July 10, 2011, 11:41:27 am »

Hi Marco,

The relevant piece of documentation for the C++ DLL extension and integrating to GDC that Pierre-Nicolas suggested is https://4js.com/online_documentation/fjs-gdc-manual-html/User/FEExtensions.html

However I think there maybe a simpler solution.  If you can get to the point where you can execute a command on the local PC where the GDC is running from the command line e.g. echo message > com1 (or something other script or executable) then you can call that from the GDC using the execute or shellexec frontCall. https://4js.com/online_documentation/fjs-fgl-manual-html/User/FrontEndFunctions.html#STANDARD

Reuben

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines