Showing posts with label FAmodule. Show all posts
Showing posts with label FAmodule. Show all posts

Tuesday, June 19, 2018

How To Compile CURI FAmodule in CentOS 7.2 with U1709 64-Bit OS and CURI 1.21

Note that this instruction is tested only with the following system and software versions:

OS: CentOS 7.2
Unison: U1709
Curi: CURI_1.12_2.121.x86_64

1. edit your project.makefile to look like this:

TARGET_MINOR_VERSION = 1

SO_TARGET = fademo_hooks.so

# -- Start of project files --
PROJECT_SOURCES = fademo_attach.cpp \
fademo_hooks.cpp  \

PROJECT_HEADERS   = fademo_hooks.h \

NO_PTHREAD=true
MBITS=64
PROJECT_INCLUDE_PATHS = -DLINUX_TARGET -DLINUX -DUNISON -I. -I/ltx/include 
PROJECT_LIBRARIES=-Wl,-rpath,/ltx/lib$(MBITS) -L/ltx/lib$(MBITS) -levxa

ifeq ("$(BUILD_OS)", "Linux")
CFLAGS:=-DLINUX_TARGET
endif

LDFLAGS:=

prepare:

Note the "MBITS=64" added

2. update all "long" arguments in fademo_hooks.h, fademo_attach.cpp, fademo_hooks.cpp to FA_LONG and "unsigned long" to FA_ULONG if any

3. use this command to compile > gmake CFG=Release MBITS=64 MBITS_CURI=64

4. after compiling as above, the .so files are stored in ~Release/ folder. rename Release to Release64 

5. update CURI config file /opt/ateTools/curi/unison/config/curi_conf.xml to point to this FAmodule:

<CURI_CONF>
    <Config Configuration_ID="DefaultConfiguration">
        <ConfigEnv Equipment_Path="/opt/ateTools/curi/unison/lib" Communications_Path="/opt/ateTools/curi/unison/lib" User_Path="/home/localuser/Desktop/famodule/Release"/>
        <CommunicationsList>
            <GPIB_IF>
                <Settings>
                    <stringSetting token="IbcAUTOPOLL" value="0"/>
                </Settings>
            </GPIB_IF>
            <RS232_IF/>
            <TTL_IF/>
            <TTL_IF DriverID="ASL PCI PORT" AccessName="ASL_XP_TTL" Library="curi_asl_ttl" />
            <TTL_IF DriverID="ASL AT PORT" AccessName="ASL_NT_TTL" Library="curi_asl_ttl" />
            <TCPIP_IF Port="65000"/>
            <USB_IF/>
        </CommunicationsList>
    </Config>

    <UserLibrary AccessName="Demo famodule" Library="fademo_hooks">
        <Settings>
    <stringSetting token="Module Type" value="FAPROC Module"/>
    <stringSetting token="Priority" value="50"/>
        </Settings>
    </UserLibrary>

Where /home/localuser/Desktop/famodule/Release is the path (without the '64' suffix) where your Famodule .so file is located and fademo_hooks is the name of the .so file

6. make sure to relaunch Unison