485 analog input register

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
MikeVerweij
Posts: 4
Joined: Sun Oct 18, 2020 7:21 pm
Contact:

485 analog input register

Post by MikeVerweij »

Hello,

My name is Mike and for a current project i am working with rs485 RTU on Flowcode 8.
I need to get an analog input working on the slave, i tried setanaloginput and read analog input, but i cant see the changes on my master.
I know how to get the digital in and outputs working but it does not work the same with the analog... I wonder if anyone can look at my code and tell me what i am doing wrong and how to get it working :D
Thanks in advance.
Attachments
Forum analoog vraag.fcfx
(15.59 KiB) Downloaded 163 times

dannyvanneijenhoff
Posts: 65
Joined: Thu Feb 07, 2008 7:59 am
Has thanked: 17 times
Been thanked: 10 times
Contact:

Re: 485 analog input register

Post by dannyvanneijenhoff »

bump :D

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: 485 analog input register

Post by viktor_au »

Hello Mike

When Modbus master sends a request to slave what is the value of byte 'raw_RX_antw_master'?
Can you insert in your code the decision:
-------------------------------------
If raw_RX_antw_master=255
--------------------------------------
Is it CRC issue?

Did you try to send to Modbus master only one analog value?

MikeVerweij
Posts: 4
Joined: Sun Oct 18, 2020 7:21 pm
Contact:

Re: 485 analog input register

Post by MikeVerweij »

hi, thanks for a reply.

I tried it but it is not a CRC fail, the slave will answer a default replay as it seems from the scope.
It doesn't matter what i set the answer will always be the same(see attachments), even if i remove everything and only initialise the slave.
I wonder if you can take a look at this and tell me what the problem is because i can't see it.

Kind regards, :D
Attachments
forum question analog input.fcfx
(19.28 KiB) Downloaded 145 times
anwser slave.png
anwser slave.png (28.11 KiB) Viewed 2478 times

viktor_au
Posts: 342
Joined: Fri Jan 26, 2018 12:30 pm
Location: South Australia
Has thanked: 44 times
Been thanked: 60 times
Contact:

Re: 485 analog input register

Post by viktor_au »

Hello Mike

I changed a bit your Slave12 and run it with FC8 run Master (not on PIC, bur Arduino).
All works OK on Arduino.

Please check you PIC hardware connections and settings.
I created a quick guide.
https://www.matrixtsl.com/mmforums/view ... 60#p103660

Post Reply