How to access serial port in RED?

I need to access some weight machines through a serial port. How can I paint / write data from / to it using the RED programming language?

+4
source share
2 answers

The serial port and most of the I / O are not yet implemented in red.

Please see the red Trello panel for an overview of the remaining parts.

+1
source

As DocKimbel mentioned, most of the IO support has not yet been implemented, but this does not mean that you cannot manually implement the functionality in Red / System.

, Windows.

, , .

, , simple-io.reds. , simple-io:

  • CreateFileA
  • ReadFile
  • WriteFile

DeleteFileA GetLastError. simple-io ( DeleteFile), , kernel32.dll stdcall . SetCommState().

BOOL WINAPI SetCommState(
  _In_ HANDLE hFile,
  _In_ LPDCB  lpDCB
);

DCB (Device Control Block) .

Red/System, ! c .

0

Source: https://habr.com/ru/post/1675218/


All Articles