Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Receive data in the PIC from HMI

(you are viewing a thread; or go back to list of threads)

Receive data in the PIC from HMI (by Carlos Torrez)
I tested with the HMI Micset digital and analog data, but not how to convert analog data (ASCII) to decimal, the idea is to read a temperature sensor (LM35)

On the other hand nose as receive data from the HMI to the PIC, in the example of shipping using the Format String Over UART but is just does not get sent.

Thanks for your help, if someone would help me enough examples
Tue Mar 29 2011, 13:50:13
David R (by Carlos Torrez)
You can help me with this?

Thanks in advance
Fri Apr 29 2011, 19:14:26
David R (by Carlos Torrez)
You can help me with this?

Thanks in advance
Fri Apr 29 2011, 19:14:49
(no subject) (by David R)
Hi yes I can help I will will build some code and post,

I don't understand your problem with the lm35 can you post the .ld file that you are using to send to Micset.
Sat Apr 30 2011, 21:36:40
(no subject) (by David R)
here is a set of code for the Pic and Micset.
please note the pic need to run fast with a fast crystal to process the incoming serial string.

Regards
David
Sun May 1 2011, 05:54:21, download attachment scada_test.ld
(no subject) (by David R)
and the Micset file
Sun May 1 2011, 05:55:14, download attachment scada_test.fxd
(no subject) (by Carlos Torrez)
Thank you very much, for example, estimated David, but I tested with a PIC16F877 and does not work sending the data from the HMI to the PIC, the PIC to send the HMI if it works perfectly, when testing on Proteus, manually income data [2, 1, W, 1] and it works perfect, what could be the problem?
Mon May 9 2011, 12:01:02
(no subject) (by David R)
What crystal and what scan time are you using ?
Mon May 9 2011, 16:32:13
(no subject) (by Carlos Torrez)
ok, 20MHz scan 0.4
Mon May 9 2011, 19:37:03
(no subject) (by David R)
Ok next can you please connect the serial port of the computer (com 1 ?) using A null modem cable to another serial port on the computer or another computer (com 2 ?)
open A terminal program (ie HyperTerminal) and set to (com 2 ?).

this allows you to see what Xedit sending.

Run Xedit and monitor what is sent from Xedit to the terminal program.

Press the buttons on Xedit and post the result.

Regards
David
Tue May 10 2011, 19:22:25
(no subject) (by Carlos Torrez)
I tested with virtual ports to do what you ask tarry because I have only one PC.
Could you help by changing the model program PIC16F877? can you are doing something wrong. And send me the program PIC16F877?

Thanks in advance
Wed May 11 2011, 19:55:33
(no subject) (by Carlos Torrez)
Ya encontre el problema estimado david elimine desde el proteus el VSM VirtualTErminal y funciona perfecto tu ejemplo.

gracias por tu tiempo

saludos
Sun May 15 2011, 12:09:51
(no subject) (by Carlos Torrez)
Dear David, I found the problem removed from the VSM proteus VirtualTErminal and your example works perfect.

thanks for your time

However, your code can not understand 100% you could help me with more feedback, thank you

Greetings
Tue May 17 2011, 13:40:36
(no subject) (by David R)
What part don't you understand ?
David.
Tue May 17 2011, 16:19:45
(no subject) (by Carlos Torrez)
1 .- At line 11 [R_rx_char ]---[ C_char_cnt], which is the goal of using the counter move?
2 .- In line 17 where the coil Set [R_not_me], because the comparison? [address> char]
3 .- In line 19 why? is subtracted by 48 [dec: = char - 48]
4 .- To take another from the HMI tag lines should be repeated to increase more tag?
Tue May 24 2011, 14:06:53
(no subject) (by David R)
1) the counter counts up a number every time the UART receives a character, this is so I know which character is being received and when to move it and when to move it.

2)as the data is received it needs to be checked that it is the correct data and is the correct format, so as each character is received the counter [ C_char_cnt] steps and the result from the lookup table is compared to the character, if it is not correct then the relay [R_not_me] is set which locks out the data receive until a new data string is received.

3)the decimal character "4" is not ascii "4" it is 52 see the attached chart.

4)I will post a new program with a small change to do that.
Wed May 25 2011, 03:08:02, download attachment asciifull.gif
(no subject) (by David R)
4) just copy the last line and change the address and data to what you need.

you can only use 0-->9 for address
Wed May 25 2011, 03:13:13, download attachment scada_test_multi_rx.ld
(no subject) (by Carlos Torrez)
I have not had time to discuss in detail your code but I still have doubts of the previous program, excuse my ignorance, I think this last code even more complicated than the first so I'd like to finish to understand the first code.
Tue May 31 2011, 11:51:08
(no subject) (by deny_jae)
dear david,
how to know register address from PIC16F877?
can you explaint to me?...
sorry for my english..
Mon Jun 27 2011, 21:52:44
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):