Welcome to the FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
The latest SmartSDR Software:
SmartSDR v4.1.5 | SmartSDR v4.1.5 Release Notes
SmartSDR v3.10.15 | SmartSDR v3.10.15 Release Notes
The latest 4O3A Genius Product Software:
The latest 4O3A Genius Product Software and Firmware
SmartSDR v4.1.5 | SmartSDR v4.1.5 Release Notes
SmartSDR v3.10.15 | SmartSDR v3.10.15 Release Notes
The latest 4O3A Genius Product Software:
The latest 4O3A Genius Product Software and Firmware
How to Receive Technical Support::
If you are needing assistance with FlexRadio products, please refer to the product documentation or check the Help Center for known solutions. Need technical support from FlexRadio? It's as simple as creating a HelpDesk ticket.
If you are needing assistance with FlexRadio products, please refer to the product documentation or check the Help Center for known solutions. Need technical support from FlexRadio? It's as simple as creating a HelpDesk ticket.
API Help
K1ESE
Member ✭✭✭
I want to access the API to turn a relay output off and on.
This works -
ampline$ = "tx1"
handle = TCPOpen(radioaddress$, 4992)
temp =TCPPrint(handle, "C0|interlock "; ampline$; "_enabled=f")
It turns off.
This doesn't -
ampline$ = "tx1"
handle = TCPOpen(radioaddress$, 4992)
temp =TCPPrint(handle, "C0|interlock "; ampline$; "_enabled=f")
It doesn't turn back on.
Please, what did I mess up?
K1ESE
This works -
ampline$ = "tx1"
handle = TCPOpen(radioaddress$, 4992)
temp =TCPPrint(handle, "C0|interlock "; ampline$; "_enabled=f")
It turns off.
This doesn't -
ampline$ = "tx1"
handle = TCPOpen(radioaddress$, 4992)
temp =TCPPrint(handle, "C0|interlock "; ampline$; "_enabled=f")
It doesn't turn back on.
Please, what did I mess up?
K1ESE
0
Answers
-
Did you mean to say "_enabled=t" (true) in the second snippet?
0 -
Not an expert on the FlexAPI but your two sample code fragments, as written here are identical. If that's what you really have, then I suspect you need to change "_enabled=f" to "_enabled=t".
0 -
Yes, I copied wrong from the program.
This doesn't work -
temp =TCPPrint(handle, "C3|interlock "; ampline$; "_enabled=t")
I'm guessing I have messed up the syntax somehow.
0 -
Do you issue commands C1 and C2 before issuing the C3 that doesn't work? There may be something going wrong in the intermediate code that you've not shown. Do you close the TCP/IP connection after each command?
0 -
As long as you asked...
Liberty Basic Code -
' TCP/IP socket functions by by Alex Davies
open "mesock32.dll" for dll as #me
[setup.main.Window]
nomainwin
WindowWidth = 200
WindowHeight = 146
UpperLeftX=500
UpperLeftY=200
loadbmp "Tune", "C:Tune Antenna Tuner SafelyTune.bmp"
loadbmp "Stop", "C:Tune Antenna Tuner SafelyStop.bmp"
'-----Begin GUI objects code
bmpbutton #main.start,"C:Tune Antenna Tuner SafelyTune.bmp",[startClick], UL, 0, 0
'button #main.reconn, " RESET ", [reconnClick], UL, 0, 76 , 184, 30
'-----End GUI objects code
open "TS" for window as #main
'print #main.reconn, "!font ms_sans_serif 14 bold"
print #main, "trapclose [quit]"
'read .ini file for address, RCA TX line, tune power
open "C:Tune Antenna Tuner SafelyTATS.ini" for input as #tuncfg
line input #tuncfg, radioaddress$
line input #tuncfg, ampline$
input #tuncfg, tunepower$
close #tuncfg
tuneflag=0
' handle = TCPOpen(radioaddress$, 4992)
' temp =TCPPrint(handle, "C4|transmit set tunepower=0")
[main.inputLoop]
wait
[startClick]
if tuneflag = 0 then
handle = TCPOpen(radioaddress$, 4992)
temp =TCPPrint(handle, "C0|interlock "; ampline$; "_enabled=f")
'temp =TCPPrint(handle, "C1|transmit set tunepower=";tunepower$)
temp =TCPPrint(handle, "C1|transmit tune on")
print #main.start, "bitmap Stop"
tuneflag=1
else
temp =TCPPrint(handle, "C2|transmit tune off")
'temp =TCPPrint(handle, "C4|transmit set tunepower=";tunepower$)
temp =TCPPrint(handle, "C3|interlock "; ampline$; "_enabled=T")
temp = TCPClose(handle)
print #main.start, "bitmap Tune"
tuneflag=0
end if
wait
'[reconnClick]
' temp = TCPClose(handle)
' handle = TCPOpen(radioaddress$, 4992)
' wait
[quit]
temp = TCPClose(handle)
close #me
close #main
end
''''Function TCPOpen()''''''''''
Function TCPOpen(address$,Port)
Timeout=1000
calldll #me, "Open", address$ As ptr,_
Port As Long,_
Timeout As Long, re As Long
TCPOpen=re
End Function
''''Function TCPReceive$()''''''''''
Function TCPReceive$(handle)
buffer=4096
all=0
calldll #me, "ReceiveA" ,handle As Long,_
buffer As Long,_
all As Long, re As long
if re<>0 then TCPReceive$ = winstring(re)
End Function
''''Function TCPPrint()''''''''''
Function TCPPrint(handle,text$)
calldll #me, "PrintA", handle As Long,_
text$ As ptr,re As Long
TCPPrint=re
End Function
''''Function TCPClose()''''''''''
Function TCPClose(handle)
calldll #me, "CloseA",handle As Long,_
TCPClose As Long
End Function
0 -
Is the issue that you used a capital "T" instead of lower case "t"? 73, Len, KD0RC0
Leave a Comment
Categories
- All Categories
- 388 Community Topics
- 2.2K New Ideas
- 658 The Flea Market
- 8.4K Software
- 156 SmartSDR+
- 6.5K SmartSDR for Windows
- 186 SmartSDR for Maestro and M models
- 439 SmartSDR for Mac
- 275 SmartSDR for iOS
- 265 SmartSDR CAT
- 204 DAX
- 386 SmartSDR API
- 9.4K Radios and Accessories
- 53 Aurora
- 297 FLEX-8000 Signature Series
- 7.2K FLEX-6000 Signature Series
- 970 Maestro
- 58 FlexControl
- 866 FLEX Series (Legacy) Radios
- 944 Genius Products
- 471 Power Genius XL Amplifier
- 347 Tuner Genius XL
- 126 Antenna Genius
- 306 Shack Infrastructure
- 215 Networking
- 468 Remote Operation (SmartLink)
- 142 Contesting
- 811 Peripherals & Station Integration
- 144 Amateur Radio Interests
- 1.1K Third-Party Software

