Welcome to the new FlexRadio Community! Please review the new Community Rules and other important new Community information on the Message Board.
Need the latest SmartSDR, Power Genius, Tuner Genius and Antenna Genius Software?
SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
SmartSDR v3.8.19 and the SmartSDR v3.8.19 Release Notes | SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
SmartSDR v1.12.1 and the SmartSDR v1.12.1 Release Notes
Power Genius XL Utility v3.8.8 and the Power Genius XL Release Notes v3.8.8
Tuner Genius XL Utility v1.2.11 and the Tuner Genius XL Release Notes v1.2.11
Antenna Genius Utility v4.1.8
If you are having a problem, 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.
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
- 282 Community Topics
- 2.1K New Ideas
- 526 The Flea Market
- 7.5K Software
- 6K SmartSDR for Windows
- 144 SmartSDR for Maestro and M models
- 350 SmartSDR for Mac
- 248 SmartSDR for iOS
- 228 SmartSDR CAT
- 169 DAX
- 352 SmartSDR API
- 8.7K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 1 FLEX-8000 Signature Series
- 839 Maestro
- 43 FlexControl
- 843 FLEX Series (Legacy) Radios
- 787 Genius Products
- 414 Power Genius XL Amplifier
- 274 Tuner Genius XL
- 99 Antenna Genius
- 242 Shack Infrastructure
- 166 Networking
- 402 Remote Operation (SmartLink)
- 124 Contesting
- 622 Peripherals & Station Integration
- 125 Amateur Radio Interests
- 860 Third-Party Software