Search found 115 matches

by SILVESTROS9
Thu May 04, 2017 3:43 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Benj, The response data is ok. The part ReadCoilStates of ModbusSlave component, works fine when I test it with a Modbus Master emulator. However not work when I send commands from PLC. Maybe the error is at PLC code (wrong register size or data type). To find where is the problem, I'll try to...
by SILVESTROS9
Wed Apr 26, 2017 11:42 am
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks Benj for your help . I'll make some tests playing with Modbus Master code for PLC, and give you info about results.
by SILVESTROS9
Mon Apr 24, 2017 3:27 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hi Benj, The command byte is 0F (WriteMultipleCoils or ForceMultipleCoils) and refers to Modbus Function 15. In some Modbus Master emulators you can select to see the data in decimal format, as it seems in my previous snaps .In the raw data you can see the real format, so the command is correct. Als...
by SILVESTROS9
Wed Apr 19, 2017 11:43 am
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hi Benj, Would you like to check the ModbusSlave component for some problems, as it seems at my previous posts ? I'm not sure if the response codes for commands 1 and 15 are correct, or there is a mistake in my FC7 code. For last tests I use the modified code (ModBus_Slave_LCD_4-DEMO-FT1.fcfx) that ...
by SILVESTROS9
Mon Apr 10, 2017 11:15 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Dear Benj, I made a test with another master emulator to confirm the response error at ModbusCommand 15. As it seems at response code, there is no data at quantity of coils . It must be 000d 005d . Above the request/response data , the test results shows 0 valid response instead of 1 , but also 0 er...
by SILVESTROS9
Mon Apr 10, 2017 6:56 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Dear Benj, I made a quick test with the new code. First I use the PLC demo code to send the byte E5(hex) . No data (leds off). At execute table I see CommError=254 . I think that there is error at response code. With master emulator I write a value 255 ( FF ) to set on the first 5 leds . When I set ...
by SILVESTROS9
Sat Apr 08, 2017 11:57 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello to all! Continuing to make tests for I/O , I've some problems mainly at modbus command 15 ( Write Multiple Coils ). I add a demo code to control 8 coils at PORTA of PIC16F1939 with PLC ( I post the code below ). First I try to send and write a byte from PLC to PIC register . As it seems at PLC...
by SILVESTROS9
Mon Mar 27, 2017 3:42 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks EtsDriver, I forgot to setup component properties. After that, I have no errors in command's responses. Now I'll continue to make some tests with I/O .
by SILVESTROS9
Mon Mar 27, 2017 12:37 am
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Benj, Before add some I/O to PIC , I was checked with help of a master emulator (Simply Modbus Master) some modbus command that I will use . I noticed that some commands as 01 (Read Coil States ) , 02 (Read Input States) , 04(Read Analog Input) and 05(Set Coil State) shows response code error ...
by SILVESTROS9
Fri Mar 24, 2017 3:54 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks Benj for your help.
Below I post the code that so far works fine. I continue the tests adding some I/O at the PIC that can be controlled from the master, and make some modifications to hardware .
by SILVESTROS9
Fri Mar 17, 2017 1:32 am
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Benj, in your previous post you write : " Right I have now added support for the WriteMultipleRegisters command. Previously it was not supported in the slave code. The command should now support up to 20 registers to be set in a single transaction. " So far , I can display up to 20 characters ...
by SILVESTROS9
Tue Mar 14, 2017 4:59 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks Benj , The Receive Buffer Size it was 20 , I set to 80 . I try to send 10 charachters per row with FirstObj = 0 and Quantity=80 from PLC. No data at display . no comm. errors , the busy is on . When I try to send data with master emulator there is no problem. The strange is that there is no c...
by SILVESTROS9
Tue Mar 14, 2017 1:14 am
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello to all and thanks in advance for any help! I made some tests about to send characters from a PLC to an LCD 4X20. When I set Quantity (is the the total number of characters that I want to sent) up to 20 , I have the correct characters at LCD ,when the FirstObj is the start address for the strin...
by SILVESTROS9
Fri Mar 03, 2017 12:18 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks Benj for your help.
Now the response code is correct, but I have no data on LCD when send a modbus command from the PLC. I continue the tests to find the reason.
by SILVESTROS9
Tue Feb 28, 2017 10:13 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

I have a hardware guide only for that PLC . Maybe the PLC use some kind of diagnostic command, maybe not. I suppose that, observing the relatively long time to enable communication at serial line. However, I think that the problem is not at PLC that works well with any modbus display.
by SILVESTROS9
Tue Feb 28, 2017 7:47 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks to all for your help! As I stated in my previous post, my target is to use the code to send some messages from a PLC to a number of LCD's . When I use an emulator there is no problem for displaying the characters, although there is a response error. That is only for communication test and che...
by SILVESTROS9
Mon Feb 27, 2017 7:42 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello to all! After last modification of the code to support Modbus command 16 (WriteMultipleRegisters), I made some tests with an LCD 4x20 as slave. I send 2 requests to the slave for 2 and 20 characters. As master I use a PLC TM221C24R (SCHNEIDER) and a master emulator ComTestPro .The results are ...
by SILVESTROS9
Wed Feb 15, 2017 10:23 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Thanks Benj ,
I'll make some tests to confirm .
by SILVESTROS9
Wed Feb 15, 2017 5:04 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Many thanks Benj, I made a copy of ModbusSlave.fcpx to components directory of FLOWCODE7, but there is no WriteMultipleRegisters command in the ModbusSlave component. Is there something wrong with the update ? How can I check that, and what modifications must be done in ModBus_Slave_LCD_4-DEMO.fcfx ...
by SILVESTROS9
Tue Feb 14, 2017 11:47 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello to all! I made some tests of code that I post below, and works fine as modbus slave. With a modbus master emulator I send characters one by one to an LCD 4X20 , using modbus command 6 (Write Single Register). The problem is , when I try to send a string of characters , 20 or more , there is a ...
by SILVESTROS9
Fri Jan 06, 2017 3:30 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Steve001,
Thanks for info. I'll try to use some Modbus master emulators to test the code in simulation mode. When I receive PIC microcontrollers I'll make some tests with hardware.
by SILVESTROS9
Thu Jan 05, 2017 3:24 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Steve001, Thanks for useful info. I change the chip in project option with PIC16F1937 , PIC16F1939 and both compiles . For now I have not any of these chips, so I made an order . Now I must confirm that the code works . Is there a Modbus Master simulator as injector to make a flowchart simulat...
by SILVESTROS9
Wed Jan 04, 2017 7:02 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Benj. According to PIC16F887 data sheet : PROG. MEMORY : 8192 bytes SRAM : 368 bytes , 4 Banks 170 bytes free. EEPROM : 256 bytes MCU is 8bit . I don't know what part of RAM uses the code , it seems that is not enough . I don't want to convert data at master, so I'll use another MCU . What in ...
by SILVESTROS9
Wed Jan 04, 2017 6:05 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Benj,
Thanks for reply . When compiling, I receive an error : 197:(1250) could not find space (160 bytes) for variable_FCV_04c01_ModbusSlave1_REGS.
by SILVESTROS9
Wed Jan 04, 2017 2:47 pm
Forum: Flowcode V7
Topic: PIC as MODBUS slave
Replies: 80
Views: 74657

Re: PIC AS MODBUS SLAVE

Hello Benj, The code Modbus_Slave_LCD works fine for the first line (0). I was added the code for lines 1,2,3 but characters not displayed at these lines. Ι noticed with the help of a master emulator, that only 20 registers can read with a Read Holding Register command. If that's true , what is that...