Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HiSLIPMessage.{cpp,h} now uses promise/future mechanism to receive messages in async-channel. #130

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
10d4d22
create a directory for HiSLIP support
noboruatkek May 8, 2020
c4d6c2c
update Readme in drvAsynHiSLIP
noboruatkek May 8, 2020
6c1cbb4
remove asynInt32xxx methods.
noboruatkek May 15, 2020
655acdb
read/write message from a HiSLIP device.
noboruatkek May 23, 2020
647eb47
delete drvAsynHiSLIP.c. replaced by drvHiSLIP.cpp
noboruatkek May 23, 2020
687a07b
separate drvAsynHiSLIP into two files.
noboruatkek Jun 24, 2020
c70dae2
separate drvAsynHiSLIP into two files.
noboruatkek Jun 24, 2020
7c2db37
separate drvAsynHiSLIP into two files.
noboruatkek Jun 25, 2020
004ae0e
Create HiSLIPMessage.cpp
noboruatkek Jun 25, 2020
c47db33
separate drvAsynHiSLIP into two files.
noboruatkek Jun 25, 2020
6321754
moved to cPyHiSLIP
noboruatkek Jun 25, 2020
9d5e45e
moved to cPyHiSLIP
noboruatkek Jun 25, 2020
5255e00
Cython setup
noboruatkek Jun 26, 2020
af110a5
for python/cython
noboruatkek Jun 26, 2020
178bacf
remote_local/request-release lock
noboruatkek Jun 27, 2020
e9be400
rest rmt_delivered flag at initilaise
noboruatkek Jun 27, 2020
6f2aa49
rest rmt_delivered flag at init.
noboruatkek Jun 27, 2020
b9fa77d
Delete HiSLIPMessage.cpp
noboruatkek Jun 27, 2020
f8920f1
Delete HiSLIPMessage.h
noboruatkek Jun 27, 2020
91001d4
add srq_lock related methods
noboruatkek Jun 27, 2020
97a5e10
compiles on MacOSX
noboruatkek Jun 28, 2020
42ffd3a
adopot to change in HiSLIPMessage.cpp
noboruatkek Jun 29, 2020
8e18540
read/ask returns just status
noboruatkek Jun 29, 2020
6cea27d
Merge pull request #1 from epics-modules/master
noboruatkek Jun 29, 2020
e36d21d
before merge with master
noboruatkek Jun 29, 2020
09c7f7e
conflict resolved with master
noboruatkek Jun 29, 2020
9498ed4
add overlap_mode to public member of cHiSLIP in pxd
noboruatkek Jun 29, 2020
1ad6f8f
release setting for local
noboruatkek Jun 30, 2020
d8989fb
add message_types for HiSLIP2
noboruatkek Jul 2, 2020
0ad49b2
Update README.txt
noboruatkek Jul 3, 2020
ad8b150
a bit of tuning
noboruatkek Jul 4, 2020
46590bf
accept single eos character
noboruatkek Jul 11, 2020
0f629ec
before merge
noboruatkek Jul 11, 2020
71a4ad3
before merge
noboruatkek Jul 11, 2020
79090b3
before merge
noboruatkek Jul 11, 2020
5e61632
SRQ handling bug fix
noboruatkek Jul 11, 2020
882c88d
remove errlogPritf
noboruatkek Jul 11, 2020
48493f6
for PyPI upload
noboruatkek Jul 15, 2020
379533f
buffer allocation size was adjusted
noboruatkek Jul 19, 2020
88e744a
buffer allocation size was adjusted
noboruatkek Jul 19, 2020
26aacaf
buffer allocation size was adjusted
noboruatkek Jul 19, 2020
a5cdb32
set TCP_NODELAY to sockets
noboruatkek Jul 19, 2020
cfe7d5b
send whole message with one socket.send call.
noboruatkek Jul 20, 2020
cf0fa12
USE_TCP_NODLAY envrionment variable is instroduced but not used as de…
noboruatkek Jul 22, 2020
edfa076
apply nogil where appropriate
noboruatkek Jul 24, 2020
901a93a
patches memoleaks.
noboruatkek Jul 24, 2020
3d5cd58
more nogis
noboruatkek Jul 24, 2020
2bf9458
prepare for push
noboruatkek Jul 25, 2020
cb6ecd8
add wait_service_request
noboruatkek Jul 31, 2020
90c92c2
in wait_Service_request, accept anyMessages type then check it
noboruatkek Jul 31, 2020
f82b789
rearange locations of method definitions between .cpp an .h
noboruatkek Aug 2, 2020
ee66f9d
add lock_info function
noboruatkek Aug 6, 2020
2854322
Merge remote-tracking branch 'upstream/master'
noboruatkek Aug 12, 2020
cbe6cd9
prepare to push
noboruatkek Aug 20, 2020
73ddadf
update README.rst ,then README.md and README.txt with make markdown
noboruatkek Aug 20, 2020
ccd3753
avoid compiler warnings
noboruatkek Oct 30, 2020
de8078e
introduce std:async for sync_channel
noboruatkek Jan 9, 2021
70cce8b
use std::async for sending/recving data to/from socket
noboruatkek Jan 9, 2021
15b7796
use std::async for sending/recving data to/from socket
noboruatkek Jan 9, 2021
07f07fa
use std::async for sending/recving data to/from socket
noboruatkek Jan 9, 2021
595a055
member initialvalues
noboruatkek Jan 30, 2021
49f2103
use promise/future in HiSLIPMessage
noboruatkek Feb 6, 2021
c7d38d2
clear cPyHiSLIP.c and cPyHiSLIP.html
noboruatkek Feb 6, 2021
35489c3
disable debug messages
noboruatkek Feb 6, 2021
2750bdd
disagle debug messages, again
noboruatkek Feb 6, 2021
dec17a3
diable remaining print statement for debug
noboruatkek Feb 6, 2021
14a27d0
diable remaining print statement for debug, again
noboruatkek Feb 6, 2021
8c3f86c
diable remaining print statement for debug,one more
noboruatkek Feb 6, 2021
2e58838
add conditions in asyn/configure/CONFIG_SITE
noboruatkek Feb 8, 2021
e2e204c
put HiSLIP flag into CONFIG_SITE.darwin-x86.Common etc.
noboruatkek Feb 10, 2021
a487400
put HiSLIP flag into CONFIG_SITE.darwin-x86.Common etc.
noboruatkek Feb 10, 2021
fdd1dd4
Merge branch 'master' of https://github.com/epics-modules/asyn
noboruatkek Feb 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 32 additions & 19 deletions asyn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ include $(TOP)/configure/CONFIG

ASYN = $(TOP)/asyn
#USR_CFLAGS += -DDEBUG
USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET
USR_CFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET
USR_CPPFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET
USR_CXXFLAGS += -DUSE_TYPED_RSET -DUSE_TYPED_DSET -DUSE_TYPED_DRVET --std=c++11

USR_INCLUDES_cygwin32 += -I/usr/include/tirpc

Expand Down Expand Up @@ -149,18 +150,18 @@ ifneq ($(EPICS_LIBCOM_ONLY),YES)
INSTALL_DBDS += $(INSTALL_DBD)/devEpics.dbd
endif
SRC_DIRS += $(ASYN)/devEpics
devEpics_DBD += devAsynOctet.dbd
devEpics_DBD += devAsynInt32.dbd
devEpics_DBD += devAsynInt8Array.dbd
devEpics_DBD += devAsynInt16Array.dbd
devEpics_DBD += devAsynInt32Array.dbd
devEpics_DBD += devAsynInt32TimeSeries.dbd
devEpics_DBD += devAsynUInt32Digital.dbd
devEpics_DBD += devAsynFloat64.dbd
devEpics_DBD += devAsynFloat32Array.dbd
devEpics_DBD += devAsynFloat64Array.dbd
devEpics_DBD += devAsynFloat64TimeSeries.dbd
devEpics_DBD += devAsynRecord.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynOctet.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt32.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt8Array.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt16Array.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt32Array.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt32TimeSeries.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynUInt32Digital.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynFloat64.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynFloat32Array.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynFloat64Array.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynFloat64TimeSeries.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynRecord.dbd
DB += asynInt32TimeSeries.db
DB += asynFloat64TimeSeries.db
INC += asynEpicsUtils.h
Expand Down Expand Up @@ -190,7 +191,7 @@ ifneq ($(EPICS_LIBCOM_ONLY),YES)
# 3.15 and above support lsi, lso and printf records
ifdef BASE_3_15
USR_CFLAGS += -DHAVE_LSREC
devEpics_DBD += devAsynOctetLs.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynOctetLs.dbd
endif

# do we have EPICS calc module (scalcout etc.)
Expand All @@ -204,20 +205,20 @@ ifneq ($(EPICS_LIBCOM_ONLY),YES)
ifdef HAVE_DEVINT64
USR_CFLAGS += -DHAVE_DEVINT64
USR_CXXFLAGS += -DHAVE_DEVINT64
devEpics_DBD += devAsynInt64.dbd
devEpics_DBD += devAsynInt64Array.dbd
devEpics_DBD += devAsynInt64TimeSeries.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt64.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt64Array.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt64TimeSeries.dbd
asyn_SRCS += devAsynInt64Array.c
asyn_SRCS += devAsynInt64TimeSeries.c
endif
devEpics_DBD += devAsynInt64Misc.dbd
devEpics_DBD += $(INSTALL_DBD)/devAsynInt64Misc.dbd
asyn_SRCS += devAsynInt64.c

DBD += $(devEpics_DBD)

SRC_DIRS += $(ASYN)/asynRecord
DBDINC += asynRecord
DBD += devAsynRecord.dbd
DBD += $(INSTALL_DBD)/devAsynRecord.dbd
asyn_SRCS += asynRecord.c
asyn_SRCS += drvAsyn.c
DB += asynRecord.db
Expand Down Expand Up @@ -261,6 +262,18 @@ ifeq ($(DRV_USBTMC),YES)
DBD += drvAsynUSBTMC.dbd
endif


ifeq ($(DRV_HISLIP),YES)
USR_CXXFLAGS += -fpermissive
SRC_DIRS += $(ASYN)/drvAsynHiSLIP
SRC_DIRS += $(ASYN)/drvAsynHiSLIP/cPyHiSLIP
asyn_SRCS += drvAsynHiSLIP.cpp
asyn_SRCS += HiSLIPMessage.cpp
DBD += drvAsynHiSLIP.dbd
INC += drvAsynHiSLIP.h
INC += HiSLIPMessage.h
endif

ifeq ($(DRV_FTDI),YES)
SRC_DIRS += $(ASYN)/drvAsynFTDI
asyn_SRCS += ftdiDriver.cpp drvAsynFTDIPort.cpp
Expand Down
2 changes: 1 addition & 1 deletion asyn/devGpib/devGpib.dbd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
device(ai,GPIB_IO,devGpib,"GPIB init/report")
device(ai, GPIB_IO, devGpib,"GPIB init/report")
12 changes: 12 additions & 0 deletions asyn/drvAsynHiSLIP/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!make

.phony: markdown
.SUFFIXES : .rst .md .txt

.rst.md:
/usr/local/bin/pandoc -f rst -t markdown -o $@ $<

.rst.txt:
/usr/local/bin/pandoc -f rst -t plain -o $@ $<

markdown: README.md README.txt
90 changes: 90 additions & 0 deletions asyn/drvAsynHiSLIP/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
EPICS ASYN support for HiSLIP device
====================================

What is this?
-------------

This module provides EPICS asyn Octet driver for HiSLIP protocol.

It should work with Stream Device library as sameway as USBTMC and
VXI11. SRQ is supported also throgh asyn octet driver.

HiSLIP protocol is implemented in cPyHiSLIP/HiSLIPMessage.{cpp,h} files.
These files does not have direct dependency on EPICS, and can be used
with any other programs. As an example, cPyHiSLIP/cPyHiSLIP.{pxd,pyx}
and setup.py are provided to build python modules for HiSLIP device.

This moduled is based on the specification descibed in:

> IVI-6.1: IVI High-Speed LAN Instument Protocol (Rev. 1.1, Feb.24,
> 2011)[^1]

How to use
----------

### For EPICS

It is assumed that this module will be used togather with the Stream
Deivce. You may need to adjust configure/RELEASE adn
configure/CONFIG\_SITE files for your environment. In some Linux
systems, you need to turn on TIRPC switch to true in
configure/CONFIG\_SITE.

To add this drvAsynHiSLIP support into StreamApp. After building a
libasyn library with drvAsynHiSLIP, you must add the following line to
the Makefile in the StreamApp directory:

> streamApp\_DBD += drvAsynHiSLIP.dbd

In the iocsh start up command, you neeed to configure asyn port for
HiSLIP device. The \"HiSLIPConfigure\" command, like \"vxi11Configure\"
for VXI-11 devices is provided.:

> \# HiSLIPConfigure \"port name\", \"host address\",
> max\_message\_size, \"priority\" HiSLIPConfigure
> \"L0\",\"172.28.68.228\", 1048560, 0 \# Keysight DSOX1204A

A port name can be any ID string if you just uses Stream driver.
However, if you may want to use SRQ with this suppor, you better to
stick with devGPIB/asyn port name convention, i.e. \"L\<n\>\".

### As Python module

At first, you need to build and install Python module based on this
library. To do so, go to the cPyHiSLIP directory under
asyn/drvAsynHiSLIP directory, then issue:

> python3 -m pip build clean install

You must have pip module and Cython tool installed. You might need to
give appropriate priviledge to install the module in the proper
location.

Build Issues
------------

> HiSLIP portocol is implemented in HiSPLIPMessage.{cpp,h}. cPyHiSLIP
> provides python module to access HiSLIP devices. It uses cython to
> wrap c/c++ librarlies. It can be used without any componets from
> EPICS. drvAsynHiSLIP provide asyOctet interface to access device.
> SRQ(IO Intr) is implemented also as asynOcted driver. So, only SI
> record can be used with SRQ.

Acknowledgements
----------------

This is based on USB TMC support by Eric Norum \<<wenorum@lbl.gov>\>.
And also PyHiSLIP modules by Levshinovskiy
Mikhail(<https://github.com/llemish/PyHiSLIP>) is used as a reference
for the implementation.

LXI Ports, Protocols, and Services

<https://www.lxistandard.org/About/LXI-Protocols.aspx>

LXI\_HiSLIP\_Extended\_Function\_Test\_Procedures\_v1\_01.pdf

[^1]: The latest version IVI-6.1 Rev.2.0 was publised in Feb.23, 2020.
New features, \"Encrypted connections\" and \"Client and server
authentication\" are not supported by this version of drAsynHiSLIP
library.
90 changes: 90 additions & 0 deletions asyn/drvAsynHiSLIP/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
===============================================================================
EPICS ASYN support for HiSLIP device
===============================================================================

What is this?
==================
This module provides EPICS asyn Octet driver for HiSLIP protocol.

It should work with Stream Device library as sameway as USBTMC and VXI11.
SRQ is supported also throgh asyn octet driver.


HiSLIP protocol is implemented in cPyHiSLIP/HiSLIPMessage.{cpp,h} files.
These files does not have direct dependency on EPICS, and can be used with any other
programs. As an example, cPyHiSLIP/cPyHiSLIP.{pxd,pyx} and setup.py are provided to
build python modules for HiSLIP device.

This moduled is based on the specification descibed in:

IVI-6.1: IVI High-Speed LAN Instument Protocol (Rev. 1.1, Feb.24, 2011)[#]_


.. [#] The latest version IVI-6.1 Rev.2.0 was publised in Feb.23, 2020. New features, "Encrypted connections" and "Client and server authentication" are not supported by this version of drAsynHiSLIP library.


How to use
=============

For EPICS
--------------



It is assumed that this module will be used togather with the Stream Deivce.
You may need to adjust configure/RELEASE adn configure/CONFIG_SITE files
for your environment. In some Linux systems, you need to turn on TIRPC switch to true
in configure/CONFIG_SITE.

To add this drvAsynHiSLIP support into StreamApp. After building a libasyn library
with drvAsynHiSLIP, you must add the following
line to the Makefile in the StreamApp directory:

streamApp_DBD += drvAsynHiSLIP.dbd

In the iocsh start up command, you neeed to configure asyn port
for HiSLIP device. The "HiSLIPConfigure" command, like "vxi11Configure" for
VXI-11 devices is provided.:

# HiSLIPConfigure "port name", "host address", max_message_size, "priority"
HiSLIPConfigure "L0","172.28.68.228", 1048560, 0 # Keysight DSOX1204A

A port name can be any ID string if you just uses Stream driver.
However, if you may want to use SRQ with this suppor, you better to
stick with devGPIB/asyn port name convention, i.e. "L<n>".


As Python module
----------------------
At first, you need to build and install Python module based on this library.
To do so, go to the cPyHiSLIP directory under asyn/drvAsynHiSLIP directory, then
issue:

python3 -m pip build clean install

You must have pip module and Cython tool installed. You might need to give
appropriate priviledge to install the module in the proper location.




Build Issues
============
HiSLIP portocol is implemented in HiSPLIPMessage.{cpp,h}.
cPyHiSLIP provides python module to access HiSLIP devices. It uses cython to wrap c/c++ librarlies.
It can be used without any componets from EPICS.
drvAsynHiSLIP provide asyOctet interface to access device. SRQ(IO Intr) is implemented also as asynOcted driver. So, only SI record can be used with SRQ.

Acknowledgements
================
This is based on USB TMC support by Eric Norum <wenorum@lbl.gov>.
And also PyHiSLIP modules by Levshinovskiy Mikhail(https://github.com/llemish/PyHiSLIP) is used
as a reference for the implementation.


LXI Ports, Protocols, and Services

https://www.lxistandard.org/About/LXI-Protocols.aspx


LXI_HiSLIP_Extended_Function_Test_Procedures_v1_01.pdf
83 changes: 83 additions & 0 deletions asyn/drvAsynHiSLIP/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
EPICS ASYN support for HiSLIP device

What is this?

This module provides EPICS asyn Octet driver for HiSLIP protocol.

It should work with Stream Device library as sameway as USBTMC and
VXI11. SRQ is supported also throgh asyn octet driver.

HiSLIP protocol is implemented in cPyHiSLIP/HiSLIPMessage.{cpp,h} files.
These files does not have direct dependency on EPICS, and can be used
with any other programs. As an example, cPyHiSLIP/cPyHiSLIP.{pxd,pyx}
and setup.py are provided to build python modules for HiSLIP device.

This moduled is based on the specification descibed in:

IVI-6.1: IVI High-Speed LAN Instument Protocol (Rev. 1.1, Feb.24,
2011)[1]

How to use

For EPICS

It is assumed that this module will be used togather with the Stream
Deivce. You may need to adjust configure/RELEASE adn
configure/CONFIG_SITE files for your environment. In some Linux systems,
you need to turn on TIRPC switch to true in configure/CONFIG_SITE.

To add this drvAsynHiSLIP support into StreamApp. After building a
libasyn library with drvAsynHiSLIP, you must add the following line to
the Makefile in the StreamApp directory:

streamApp_DBD += drvAsynHiSLIP.dbd

In the iocsh start up command, you neeed to configure asyn port for
HiSLIP device. The "HiSLIPConfigure" command, like "vxi11Configure" for
VXI-11 devices is provided.:

# HiSLIPConfigure "port name", "host address", max_message_size,
"priority" HiSLIPConfigure "L0","172.28.68.228", 1048560, 0 # Keysight
DSOX1204A

A port name can be any ID string if you just uses Stream driver.
However, if you may want to use SRQ with this suppor, you better to
stick with devGPIB/asyn port name convention, i.e. "L<n>".

As Python module

At first, you need to build and install Python module based on this
library. To do so, go to the cPyHiSLIP directory under
asyn/drvAsynHiSLIP directory, then issue:

python3 -m pip build clean install

You must have pip module and Cython tool installed. You might need to
give appropriate priviledge to install the module in the proper
location.

Build Issues

HiSLIP portocol is implemented in HiSPLIPMessage.{cpp,h}. cPyHiSLIP
provides python module to access HiSLIP devices. It uses cython to
wrap c/c++ librarlies. It can be used without any componets from
EPICS. drvAsynHiSLIP provide asyOctet interface to access device.
SRQ(IO Intr) is implemented also as asynOcted driver. So, only SI
record can be used with SRQ.

Acknowledgements

This is based on USB TMC support by Eric Norum <wenorum@lbl.gov>. And
also PyHiSLIP modules by Levshinovskiy
Mikhail(https://github.com/llemish/PyHiSLIP) is used as a reference for
the implementation.

LXI Ports, Protocols, and Services

https://www.lxistandard.org/About/LXI-Protocols.aspx

LXI_HiSLIP_Extended_Function_Test_Procedures_v1_01.pdf

[1] The latest version IVI-6.1 Rev.2.0 was publised in Feb.23, 2020. New
features, "Encrypted connections" and "Client and server authentication"
are not supported by this version of drAsynHiSLIP library.
21 changes: 21 additions & 0 deletions asyn/drvAsynHiSLIP/cPyHiSLIP/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/build/
/dist/
/cfg/
/bin/
/lib/
/db/
/dbd/
/html/
/include/
/templates/
/configure/*.local
*_2.*
*_3.*
*~
O.*
*.swp
*_BAK.adl
/QtC-*
cdCommands
envPaths
dllPath.bat
Loading