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.21 and the SmartSDR v3.8.21 Release Notes
SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
Power Genius XL Utility v3.8.9 and the Power Genius XL Release Notes v3.8.9
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.21 and the SmartSDR v3.8.21 Release Notes
SmartSDR v2.12.1 and the SmartSDR v2.12.1 Release Notes
Power Genius XL Utility v3.8.9 and the Power Genius XL Release Notes v3.8.9
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
- 300 Community Topics
- 2.1K New Ideas
- 548 The Flea Market
- 7.6K Software
- 6.1K SmartSDR for Windows
- 149 SmartSDR for Maestro and M models
- 378 SmartSDR for Mac
- 253 SmartSDR for iOS
- 239 SmartSDR CAT
- 176 DAX
- 361 SmartSDR API
- 8.9K Radios and Accessories
- 7K FLEX-6000 Signature Series
- 68 FLEX-8000 Signature Series
- 870 Maestro
- 45 FlexControl
- 849 FLEX Series (Legacy) Radios
- 819 Genius Products
- 427 Power Genius XL Amplifier
- 286 Tuner Genius XL
- 106 Antenna Genius
- 252 Shack Infrastructure
- 173 Networking
- 411 Remote Operation (SmartLink)
- 130 Contesting
- 665 Peripherals & Station Integration
- 128 Amateur Radio Interests
- 895 Third-Party Software