v24Write()

Writes data to the interface.

Synopsis

int v24Write( int handle, string / blob value);

Parameters

Parameter Description
handle The handle of v24Open
value A string or blob, which contains the values. Strings are automatically closed with a 0 byte.

Return value

-1 if an error occurs, otherwise the amount of written bytes.

Error

Missing or wrong arguments.

Description

Writes data to the interface.

When writing on the interface some devices require fully completed commands ("\r\n")!

Example

In the following example the handle is written to a text field and afterwards is read from the text field for writing. The function is executed with a fully completed command.

main()
{
  int write, close, handle;
  handle = v24Open("COM2", 9600, "8N1");
  DebugN(handle); 
  handle = hndltext.text;
  write = v24Write(handle, "Does that function now???\r\n");
  DebugN(write);
  // hndltext.text = handle;
  delay(60);
  close = v24Close(handle);
  DebugN(close);
}

Assignment

Communication functions

Availability

CTRL