ICENET

From ICE Enterprises
Jump to navigation Jump to search

handles ICE network functions

<func>  Function to perform (SET,GET,MSG,ACQ,FILE,IMPORT,EXPORT)
<addr>  Network Address or HW alias
<file>  File or command to send
<flags> Flags to specify function (RMIF,HTTP,RTAB)
<size>  Length of snapshot in bytes
<loop>  Number of passes through buffer

The ICENET routine in the $ICEROOT/test directory can be used to control and/or test ICE Network Appliances.

To start or stop an appliance that has already been instantiated:

  nM> icenet SET udp:192.168.0.199:7777/192.168.0.123:9000 {ACTION=REC} RMIF
  nM> icenet SET udp:192.168.0.199:7777/192.168.0.123:9000 {ACTION=STOP} RMIF

or

  nM> icenet SET tcp:192.168.0.199:7777/192.168.0.123:9000 {ACTION=REC} HTTP
  nM> icenet SET tcp:192.168.0.199:7777/192.168.0.123:9000 {ACTION=STOP} HTTP

where 192.168.0.199:7777 is the address and port of the local NIC card to use
and 192.168.0.123:9000 is the address and port of the remote ICE Appliance.

If the controller nic card address is not supplied, it defaults to localhost:7000.
The udp: and tcp: transport modifiers are optional if RMIF or HTTP flags are specified.

To get the value of a control in the 1st snapper instance:

  nM> icenet GET 192.168.0.123:9001 FREQ HTTP
  returns: Ret?{FREQ=10.000}

or for multiple controls:

  nM> icenet GET 192.168.0.123:9001 {FREQ,GAIN} HTTP
  returns: Ret?{FREQ=10.000,GAIN=0}}

If a get has a value specified, the command will poll until that value is returned.

  nM> icenet SET 192.168.0.123:9001 {ACTION=STOPTOP} HTTP
  returns: Ack?{ACTION=STOPTOP}
  nM> icenet GET 192.168.0.123:9001 {ACTION=STOP} HTTP
  returns: Ret?{ACTION=STOP}       when top of host buffer is reached

To set the frequency and gain of channel 4 in a tuner bank:

  nM> icenet SET 192.168.0.123:9001 {CHAN=4,FREQ=1.23,GAIN=3} HTTP
  returns: Ack?{CHAN=4,FREQ=1.23,GAIN=3}

To acquire a network stream from an ICE appliance for test or validation:

  nM> icenet ACQ udp:192.168.0.199:7777/224.1.2.3:7777 filename ICE len 

where <len> is the number of bytes in the snapshot written to <filename> in Midas format.

When executed from X-Midas or NeXtMidas the address can be replaced by an alias in the HW config file.
The entry must start with ICENIC or ICESRV and should look something like:

  NIC1X==ICENIC,ADDR=localhost:7001/192.168.0.101:9001,
or
  SRV1==ICESRV,ADDR=192.168.0.101:9001,

The RMIF transport is only allowed to access the macro controls which define the macro's public interface.
The HTTP transport defaults to the same access rules but with the RTAB modifier will access the Macro's entire results table.
Thus to retrieve the GPSDAT results from a SNAPPER/SERVER=9001/GPS=2 with a GPS module on the 2nd IO module site:

  nM> icenet get nic1x "GPSDAT" "RTAB" 

To get just the seconds of Year from the GPSDAT result which is itself a table into the local results named mysoy:

  nM> icenet get nic1x "GPSDAT.SOY" "RTAB"  /label=mysoy

To start a GPS server on an ICE card with a GPS module on the MODULE2 site:

  nM> pic/server=9009 GPS pic1auto

or from a batch script:

  $NMROOT/os/nmbat PIC/SERVER=9009/GPS=2 GPS PIC1AUTO

Switches:

 /LABEL=rlab	Results name to recieve the return status in string form
 /TABLE=rlab	Results name to recieve the return values in table form
 /RESULT=rlab	Results name to recieve the return value of a single parameter