User Tools

Site Tools


\fScan Reference Manual, Chapter 2 (CmdLineOptions): connect

Connect -- Open a network or external communication port connection


-connect mode name [flag] hostport timeout
-connect READ name [flag] storevarb [maxchars timeout]
-connect WRITE name [flag] data [nchars]
-connect QUERY name querystr [flag] replydata [timeout maxchars]
-connect CLOSE name
-connect POLL name
-connect NOPOLL name


  • SOCKET - network port (default mode)
  • SERVER - network connection for fScan image server/client
  • CLIENT - network connection for fScan image server/client
  • DBAX - network connection to DBAX database server
  • COM - serial port


  • Opening
    • 1 - open for reading
    • 2 - open for writing
    • 4 - listening port; wait for client to connect
  • Writing
    • 0 - default
    • 1,2 - write data variable DATA
  • Reading
  • 1 - expect single return value
  • 2 - expect table (list) to br read

Note: fScan server connects with flag=7; fScan client with flag=3.

If you attempt to WRITE or QUERY a connection, that has not yet been opened, CONNECT will
look for the HOSTPORT specification in a user variable called “connect_CNXNNAME” (where CNXNNAME is the name of the connection). If found, CONNECT will attempt an auto-connection to that network location before attempting the WRITE/QUERY. This is equivalent to inserting the command:

   -connect name $connect_name 

For example, if you routinely connect to a DBAX database server, you could define 'connect_dbax' in your CONFIG file as:

  <uservarb name="connect_dbax"></uservarb> 

Then you could communicate with that server by simply using commands like:

   -connect dbax query "select subjid,exam,sex,age from exams" 2 examtable 

See Also:
fScan Home,
fScan Manual,
Manual Help

jvs/fscan/manual/chapter2/connect.txt · Last modified: 2014/08/04 16:03 (external edit)