# ØMQ–LabView interface test #
This repo contains python code for testing the ZeroMQ interfaces between the LabView DAQ and a python process.  

ZeroMQ Python bindings ([PyZMQ](https://pyzmq.readthedocs.io/en/latest/)) can be installed with:

```
#!bash

# (Windows or OS X)
pip install --wheel pyzmq
# or
easy_install pyzmq
# or (pretty much anywhere)
pip install pyzmq

```

### The main test script is `zmq_LabView_test.py`.

Default ports are:

* `tcp://localhost:5556` to connect to the `zmq.REQ/REP` server.
* `tcp://localhost:5557` to connect to the `zmq.PUB/SUB` publish stream.

Alternatively, you may specify the ports as inputs like so:

```
#!bash

# python zmq_LabView_test.py [zmq.REP port] [zmq.PUB port]
$ python zmq_LabView_test.py 5551 5552

```

The scripts `zmq_LabView_sub.py` and `zmq_LabView_req.py` can be used to simulate the LabView interface.

### Message format

**Data:**

* "data_header,unix_epoch_timestamp,value\n" (example: `current,1483559535.429180,47.000000\n`)

**Pitchback commands:**

* move: "start_pitchback,value" (example: `start_pitchback,5.000000`)
* stop: "stop_pitchback"
* home: "home_pitchback"