Hi all,
When I make the seq in my ioc, I met some questions. I use synapps5_8, seq-2-2-1, fedora27(64), base 3.14.15.
I setup sncNewRT.stt file and did the following step as the manual of seq said:
"Assume you have a SNL program file named *test.st* then the steps to
build are, in principle::
snc test.st
cc -c test.c -o test.o ...additional compiler options...
cc test.o -o test ...additional linker options...
or, if SNL sources are to be pre-processed::
cc -E -x c test.st > test.i
snc test.i
cc -c test.c -o test.o ...additional compiler options...
cc test.o -o test ...additional linker options..."
I did it as "not pre-processed" way, typed "snc sncNewRT.stt ", "cc -c sncNewRT.c -o sncNewRT.o ", then "cc sncNewRT.o -o sncNewRT".
When I typed the last command( cc sncNewRT.o -o sncNewRT ), I got the following error:
**************************************************
[lyx@localhost src]$ cc sncNewRT.o -o sncNewRT
/usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
sncNewRT.o: In function `seqg_event_tem_change_0_init':
sncNewRT.c:(.text+0x37): undefined reference to `seq_delay'
sncNewRT.o: In function `seqg_action_tem_change_0_cool':
sncNewRT.c:(.text+0x141): undefined reference to `seq_pvPutTmo'
sncNewRT.o: In function `seqg_action_tem_change_0_heat':
sncNewRT.c:(.text+0x1e1): undefined reference to `seq_pvPutTmo'
sncNewRT.o: In function `sncNewRTRegistrar':
sncNewRT.c:(.text+0x1ed): undefined reference to `seqRegisterSequencerCommands'
sncNewRT.c:(.text+0x1f7): undefined reference to `seqRegisterSequencerProgram'
collect2: error: ld returned 1 exit status
My sncNewRT.dbd:
**************************
registrar(sncNewRTRegistrar)
My sncNewRT.stt:
***************************
program sncNewRT
float tem_indoor;
int run_cool_heat;
int run_auto;
int tem_up;
int tem_low;
assign tem_indoor to "{user}:Tem_indoor";
assign run_cool_heat to "{user}:Air_Run";
assign tem_up to "{user}:Tem_Up";
assign tem_low to "{user}:Tem_Low";
assign run_auto to "{user}:Run_Auto";
monitor run_auto;
monitor tem_indoor;
monitor tem_up;
monitor tem_low;
ss tem_change {
state init {
when (delay(3)) {
printf("sncNewRT start\n");
if (run_auto == 0)
printf("run_auto = 0\n");
else
printf("run_auto != 0\n");
} state cool
}
state cool {
when (tem_indoor > tem_up) {
printf("begin to cool\n");
run_cool_heat = 1;
pvPut(run_cool_heat);
} state heat
}
state heat {
when (tem_indoor < tem_low) {
printf("begin to heat\n");
run_cool_heat = 2;
pvPut(run_cool_heat);
} state cool
}
}
My makefile in App/src:
***************************
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
LIBRARY_IOC += Longin
DBD += Longin.dbd
Longin_SRCS += devLongin.c
Longin_LIBS += $(EPICS_BASE_IOC_LIBS)
#=============================
# Build the IOC application
PROD_IOC = NewRT
# NewRT.dbd will be created and installed
DBD += NewRT.dbd
# NewRT.dbd will be made up from these files:
NewRT_DBD += base.dbd
# Include dbd files from all support applications:
NewRT_DBD += Longin.dbd
# Add all the support libraries needed by this IOC
#NewRT_LIBS += xxx
# NewRT_registerRecordDeviceDriver.cpp derives from NewRT.dbd
NewRT_SRCS += NewRT_registerRecordDeviceDriver.cpp
# Build the main IOC entry point on workstation OSs.
NewRT_SRCS_DEFAULT += NewRTMain.cpp
NewRT_SRCS_vxWorks += -nil-
NewRT_LIBS += Longin # add the line
# To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file
ifneq ($(SNCSEQ),)
# Build sncExample into exampleSupport
sncNewRT_SNCFLAGS += +r
NewRT_DBD += sncNewRT.dbd
# A .stt sequence program is *not* pre-processed:
NewRTSupport_SRCS += sncNewRT.stt
NewRTSupport_LIBS += seq pv
NewRT_LIBS += seq pv
# Build sncProgram as a standalone program
PROD_HOST += sncProgram
sncProgram_SNCFLAGS += +m
# A .st sequence program *is* pre-processed:
sncProgram_SRCS += sncProgram.st
sncProgram_LIBS += seq pv
sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif
# Finally link to the EPICS Base libraries
NewRT_LIBS += $(EPICS_BASE_IOC_LIBS)
#===========================
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE
Could you give me some suggestion.
Regards,
Liang yx
- Replies:
- Re: seq error Ralph Lange
- Navigate by Date:
- Prev:
Re: SubArray to ai record Amien Crombie
- Next:
Re: seq error Ralph Lange
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: How to start EPICS IOC via LabVIEW on cRIO Baily, Scott A
- Next:
Re: seq error Ralph Lange
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
<2018>
2019
2020
2021
2022
2023
2024
|