≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Javascript interface with RS-232 Serial Port
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b][/b] wrote: Ok, just to give it a try ... Since CC can send commands to the DOS prompt, I used it as workaround. The downside are the flashes on the screen for opening and closing of the prompt. It's a simple implementation, I hope this can be useful anyway. I assume that all files are in the same folder of the CC.exe. [b]--- Write ---[/b] [code] // create the LOCKED file... system('copy nul .\\LOCKED'); var data = "your data to write in..." // write the data in the shared file... ccbWriteFileContent(".\\shared.txt", data); // delete the LOCKED file... system('del .\\LOCKED'); // start the exe_in_the_middle, if needed... system('start .\\your_exe.exe'); [/code] [b]--- Read ---[/b] [code] // if the LOCKED file does not exists, create a new file named "rt" (or what you want) and write q into it... // you can write what you want but to avoid some problem with the string formatting I suggest to write one character only. system('dir .\\LOCKED || copy nul .\\rt && echo q>>.\\rt'); // read the content of the rt file... var s = ccbReadFileContent(".\\rt"); // s != undefined when the LOCKED file does not exists. if (s != undefined && s.charAt(0) == 'q') { // read the data from the shared file... s = ccbReadFileContent(".\\shared.txt"); // delete the rt file... system('del .\\rt'); print(s); //for debug only... } [/code] You can download the CC file here: [url]https://drive.google.com/file/d/10ZluLYrl_F_F42YNdujezAGCnMrhMr6o/view?usp=sharing[/url][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact