Keyboard Shortcuts
Likes
- Nodered-Hamradio
- Messages
Search
Re: How to add leading zeros to a number
开云体育AlanThe issue is he may need 0, 1, or two leading zeroes thus the if else statement is probably best solution.? 73 Dave Sent from my waxed string and tin cans.? On Feb 28, 2021, at 5:07 PM, Alan Blind, WA9WUD <a.alan.blind@...> wrote:
|
Re: How to add leading zeros to a number
开云体育Try this ? Only need <= and not <== ? Heading out to dinner for my birthday. ? 73 Dave wo2x ? ? From: [email protected] <[email protected]> On Behalf Of Charlie Rubenstein
Sent: Sunday, February 28, 2021 4:44 PM To: [email protected] Subject: Re: [nodered-hamradio] How to add leading zeros to a number ? It didn't like that...... |
Re: How to add leading zeros to a number
开云体育Function node ? If (msg.payload <== 9) { ????????????? msg.payload = “00” + msg.payload; } else if (msg.payload <== 99) { ????????????? Msg.payload = “0” + msg.payload; } Return msg; ? If the number is between 0 and 9 it will add two zeroes to the front If between 10 – 99 it adds one zero If 100 + it passes msg.payload not changed. ? Dave wo2x ? ? From: [email protected] <[email protected]> On Behalf Of Charlie Rubenstein
Sent: Sunday, February 28, 2021 4:09 PM To: [email protected] Subject: [nodered-hamradio] How to add leading zeros to a number ? I have made some great progress today with the Flex3000 flow. I solved the problem of the built-in TCP server in PowerSDR not accepting multiple connections, with a program I found called Com by TCP. I run it on the host PC that runs PSDR, and add that COM port as a CAT port in PSDR. It's working well, and I can "connect" payloads from different command buttons and switches, and it responds perfectly. |
How to add leading zeros to a number
I have made some great progress today with the Flex3000 flow. I solved the problem of the built-in TCP server in PowerSDR not accepting multiple connections, with a program I found called Com by TCP. I run it on the host PC that runs PSDR, and add that COM port as a CAT port in PSDR. It's working well, and I can "connect" payloads from different command buttons and switches, and it responds perfectly.
I hit a roadblock with sliders. The slider node outputs a number, but the command requires a 3-digit number, including leading zeros. I tried making a function node with? "msg.payload = parseInt(msg.payload (0,3))"? but that didn't work.? I know it's just my ignorance in syntax. So......how to you add leading zeros to a payload that doesn't have them? thanks, Charlie KB8CR |
Moderated
Re: Trying to read things from Flex 3000 using CAT commands
toggle quoted message
Show quoted text
On Feb 27, 2021, at 9:40 PM, Charlie Rubenstein <charlier@...> wrote:
|
Moderated
Re: Trying to read things from Flex 3000 using CAT commands
It's currently going thru a TCP port to a "TCP CAT Server" in PowerSDR. I don't know how I can adjust it's baud rate.
Charlie KB8CR |
Moderated
Re: Trying to read things from Flex 3000 using CAT commands
开云体育You could use a USB crossover cable to go from the Pi to PC. Then use a serial request Node on the Pi and in PowerSDR you choose the com port the cable creates.?Another thing to check, can you increase the baud rate you are using now? 73 Dave wo2x Sent from my waxed string and tin cans.? On Feb 27, 2021, at 8:52 PM, Charlie Rubenstein <charlier@...> wrote:
|
Re: Newbie Programming Question
开云体育Hi SteveWelcome aboard! The people on here have done a lot of great things with Node Red. ?It is an easy was to integrate software, hardware, and Internet services together! (That is from the Node Red description on node red.org) 73 Dave wo2x On Feb 27, 2021, at 7:35 PM, Steve Nance <snance@...> wrote:
|
Moderated
Re: Trying to read things from Flex 3000 using CAT commands
I uploaded v.0.2 of the Flex 3000 flow. I finally (after a couple of ridiculously late nights) get most of the bugs out.?
What I can't do still is to send commands to the radio through the same TCP serial connection as the polling I'm doing now. It seems to ignore the commands. I guess it's just too much to ask of the one connection.....That's why I thought about running NodeRed?ON the PC that runs PowerSDR. Then, I could use a virtual serial port, and PowerSDR allows for several COM port connections to it, that usually work FB. But alas I'm having problems getting NodeRed to run on the PC. It runs, but won't display the dashboard to a web browser.? Here's what it looks like now: Charlie KB8CR |
Newbie Programming Question
While I've done a lot of Windows programming I'm new to Node-Red and its programming languages specifically Node.js and JSON. However, I do have some background with Java Script. I would appreciate some guidance on which reference books would be good ones to add to the library.
TIA and 73, Steve - K5FR |
File //KB8CR's Flows/Flex3000v02.json updated
#file-notice
[email protected] Notification
The following files have been updated in the Files area of the [email protected] group. By: Charlie Rubenstein <charlier@...> Description: |
File /Webswitch Remoterig 1216H.json uploaded
#file-notice
[email protected] Notification
The following files have been uploaded to the Files area of the [email protected] group. By: Simon Ravni? <s53zo@...> Description: |
Re: File /Flex3000Flow.rtf uploaded
#file-notice
Dave:
OK, I already had changed the IP for the radio in the FlexRadio flow, but I hadn't put the IP in the ping node. Now it is returning FALSE, so that function node I made works again.? Now I know TWO ways to zero the meters. :-)? Thanks !! Charlie |
Re: File /Flex3000Flow.rtf uploaded
#file-notice
开云体育Make sure you use both my VITA49 and FlexRadio v6 flows. They are in a single zip file. ?Read the comment nodes in both. You need to set the IP to the radio IP in the TCP FlexRadio flow and the ping node in the VITA49 flow. Start Node Red first, then connect the client.Dave wo2x On Feb 26, 2021, at 10:57 PM, Charlie Rubenstein <charlier@...> wrote:
|
Re: File /Flex3000Flow.rtf uploaded
#file-notice
Well.....at least it worked LAST night.....tonight the ClientStatus is NULL....don't know why. I even went to the Flex Radio flow of yours and put a debug node on the output of?
BUT, I found another way......I found that the json string that comes from FRStack sends a "0" for the S-Meter when the radio is disconnected. So, I made a switch that only passes the S-meter number when the number is < 0 (port 1), and if the number is equal to "0" (port2) I had a change node set the payload to -120 (which zeros the meter).? It's working that way. Charlie KB8CR |