Search found 23 matches

Return

by medelec35
Thu Dec 29, 2016 12:10 am
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hi SILVESTROS9, To send a PIC register to LCD you first need to create a variable or any name e.g RegisterContents Then using a C code Block use format FCV_REGISTERCONTENTS = OSCCON; Even though variable called RegisterContents only has the 1st & 8th letters as upper case, when used with a c cod...
by medelec35
Fri Dec 30, 2016 7:54 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Perhaps best to start all windows from scratch. First close Flowcode V7 Then run registration editor. Normally just select PC run box then enter regedit Select HKEY_CURRENT_USER\SOFTWARE\ Delete MatrixTSL key. Restart Flowcode. Note: When starting a new flowchart and only Start page can be seen then...
by medelec35
Fri Dec 30, 2016 11:08 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

If you post flowchart causing errors, I will take a look.
by Benj
Tue Jan 03, 2017 12:54 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello, In your program you are writing an uninitialised variable pic_reg to holding register 0. You then convert the variable to a string and print to the LCD. So at no point do you read the value passed in from the master. Here is hopefully a better program that will take the values in the holding ...
by Benj
Tue Jan 03, 2017 12:33 pm
Jump to forum
Jump to topic

Re: MODBUS SLAVE COMPONENT

Hello, add some functions to Modbus Slave component, to cover Modbus functions 15 ( Write Multiple Coils ) and 16 ( Write Multiple Registers ) These functions should already be supported and enabled in the Slave. i.e. the Master can use these functions and the slave will respond correctly. The slave...
by Benj
Wed Jan 04, 2017 6:19 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello, Sounds like the 80 x 16-bit modbus registers cannot fit into your devices RAM, the eaisest option is to use a different microcontroller with more RAM available. As the modbus registers are 16-bit you could get away with using 40 registers instead of 80 to store the 80-byte ASCII LCD data but ...
by Benj
Wed Jan 04, 2017 7:37 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello, The following chips have the same pin out as the 887 chip but more RAM. 16F1937 - 512 Bytes 16F1939 - 1024 Bytes Or this chip has a lot more memory but a different pin out. 16F18877 - 4096 Bytes Before you buy any more chips change the chip in the project options and make sure it will actuall...
by Steve001
Thu Jan 05, 2017 1:54 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello SILVESTROS9 you could have a look at this post to help find a device https://www.matrixtsl.com/mmforums/viewtopic.php?f=54&t=16403&hilit=picpac+list#p69835 Please note this is for V6 so double check that the device is compatible with V7 as ben says Before you buy any more chips change ...
by Steve001
Thu Jan 05, 2017 6:50 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello SILVESTROS9 there are a couple of ways around this make a master device using flow code and the associated hardware you could use modscan - this requires use of a RS232 - RS485 converter Modscan http://www.win-tech.com/html/modscan32.htm I have never used it to write coils though Steve
by Benj
Thu Mar 02, 2017 4:49 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello,

Many thanks for letting us know of the problem. I have found and hopefully fixed the problem in the attached component.

ModbusSlave.fcpx


Let me know how you get on.
by Benj
Fri Mar 17, 2017 11:42 am
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello, I believe I have found and fixed the issue. The data was being read out the comms circular buffer into a local buffer which was fixed at 40 bytes or 20 registers. This variable is now dynamically sized based on your max receive buffer property setting. Ideally I would like to keep the data in...
by EtsDriver
Mon Mar 27, 2017 3:57 am
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Have you set up the register counts for coils and analog?
FC 7 is smart and the code will answer "Illegal data adress" if it has no corresponding registers set up on components properties for that function code.
4x registers are Holding registers.
by Benj
Tue Apr 25, 2017 12:43 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Right I think I have found the problem now.

Have a go with this updated component and let me know how you get on.

Simply copy the file into your "Flowcode 7/components" folder and restart Flowcode for the changes to be loaded.

ModbusSlave.fcpx
by dannyvanneijenhoff
Sun May 07, 2017 11:34 am
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

I have the master working with an 16F887 with write single coils (not multiple coils). And the slave is responding correct. But i have no working reading from the data which are received from the slave. Perhaps we help each other. :mrgreen: I have attached the program and added the links. If i have ...
by Benj
Mon May 22, 2017 3:33 pm
Jump to forum
Jump to topic

Re: CONTROL SD-MP3 RECORDER WITH RS232

Hello,

Yes you're currently sending in ASCII format, here is a modified version of your program in binary format.

SE1-RECORDER-DEMO-01.fcfx
by Benj
Thu Jun 15, 2017 3:34 pm
Jump to forum
Jump to topic

Re: PIC AS MODBUS SLAVE

Hello, Yes the data is 16-bits per location. To use all 16-bits you would have to take the two ASCII bytes and pack then into a single value by doing something like this. wordvalue = bytesval0 + ( byteval1 << 8 ) So you store one byte in the lower 8 bits and the other byte in the upper 8 bits. The <...
by Benj
Thu Aug 17, 2017 12:44 pm
Jump to forum
Jump to topic

Re: PIC as MODBUS slave

Hello, From your schematic it looks like you're missing a resistor between pin 1 of the micro and VCC to pull the MCLR/Reset pin high. A value in the range of 1K to 100K should work well. The 16F1937 has a configuration option for internal MCLR but the 18F458 does not which maybe explains the differ...
by QMESAR
Tue Nov 14, 2017 6:33 am
Jump to forum
Jump to topic

Re: CLOCK PULSE WITH PIC32

Hi need a clock in the area of ns . Is it possible to use a PIC32MZ or PIC32MX to produce a clock in the area 200ns-800ns Yes this is absolute possible for example a PIC32MX470F512H running at 120MHZ can produce single or pulse trains below 200nSec's PIC32MZ will even do better but it is an expensiv...
by Benj
Mon Feb 12, 2018 2:10 pm
Jump to forum
Jump to topic

Re: PULSE IN A SUBRUTINE WITH FC7

Hello,

Have you tried using a timer interrupt? Sounds to me like it may be the best way to do it.

The software based PWM example at the link below may be useful.
https://www.matrixtsl.com/wikiv7/index. ... Interrupts
by Benj
Wed Mar 28, 2018 10:23 am
Jump to forum
Jump to topic

Re: PASSWORD SECURITY SYSTEM WITH PIC16F1939

Hello, Have you seen the lock example here. https://www.matrixtsl.com/wikiv7/index.php?title=Component:_Circular_Buffer_(Storage)#Keypad_Based_Door_Entry_System You could easily adapt this so that the code is stored in EE memory and allow for the key to be changed, say after entering the key you the...
by Benj
Wed May 16, 2018 10:54 am
Jump to forum
Jump to topic

Re: PWM NOT WORK ON PIC16F1939

Hello, It looks like the definition file is wrong for the 16F1939, the PWM pins should match those of the 16F1937 device. Sorry for any inconvenience caused. The definition was using the 16F1938 pin configuration but this uses a smaller IC package. Here is the corrected definition file. 16F1939.fcdx...
by medelec35
Fri Jul 27, 2018 8:56 pm
Jump to forum
Jump to topic

Re: BLUETOOTH MODULE NOT WORK

State is just an output that is high when there is an established connection. Do you have an LCD you can use that for diagnostics? Your hardware is different to mine. I have both HC05/06 from a few different suppliers. All HC05 are 6pin with an enable switch + enable state pins that must have enable...
by medelec35
Mon Apr 08, 2019 1:52 pm
Jump to forum
Jump to topic

Re: INTERRUPT FOR PIC 16F1937

unfortunately , I have no free pins in PIC , only E.2 (ADC7) and B.5 (ADC2) . What I would do in that case is swap E2 with any port B pin's so you have 2 portB pins free. Add a dual comparator e.g LM293 with the correct bias resistors. The outputs of the comparators can then go the port B pins whic...