NX-1200 and Netlinx
Kareem
Posts: 1
Hi Dears
I have NX-1200 in control system and i need to monitoring or supervise this controller.
I.e when any push any inputs from I/o port in need to log file contain the strings performed due to this push.
thanks.
0
Comments
From NetLinx Keyword help:
File Operations Example: Writing to a File
The following example code demonstrates writing to a file (typical usage):
DEFINE_FUNCTION appendToFile (CHAR cFileName[],CHAR cLogString[])
{
STACK_VAR SLONG slFileHandle // stores the tag that represents the file (or and error code)
LOCAL_VAR SLONG slResult // stores the number of bytes written (or an error code)
slFileHandle = FILE_OPEN(cFileName,FILE_RW_APPEND) // OPEN OLD FILE (OR CREATE NEW ONE)
IF(slFileHandle>0) // A POSITIVE NUMBER IS RETURNED IF SUCCESSFUL
}
Which would be called like this:
appendToFile(‘log.txt’,’Something happened…’)
when an entry to this file needed to be written.
Use the FILE_RW_APPEND constant for the IOFlag to append new data to the file.