saucekorn69

MrPLC Member
  • Content count

    10
  • Joined

  • Last visited

Community Reputation

0 Neutral

About saucekorn69

  • Rank
    Sparky
  • Birthday 10/24/82

Contact Methods

  • MSN saucekorn69
  • Website URL http://www.exainc.com
  • ICQ 0

Profile Information

  • Location Montréal

Recent Profile Visitors

1379 profile views
  1. DF1 protocol problems

    Thanks, but I already read this topic which as you said, really helped me. My driver perform all this kind of command described there, but I'm still stuck on timeouts problems...
  2. DF1 protocol problems

    Ok, I'm replying to myself, maybe someone will be able to give me an advice. My problem is that ReadPollRate value is not enough big, but according to Jiri Toman, I have to calculate it using baud rate value and numbers of integers I'm about to read. Fact is that i know my baudrate (19200) but I want to read an undetermined number of integers, so I'm kind of stuck... Can anyone help me ? Nicolas Chaillou.
  3. Hi everyone, I'm currently writting a driver in order to communicate with a AB Micrologix 1500 following DF1 Protocol under vb.net. I succesfully implemented read and write with 3 adress fields, but It seems not working properly when I send unlimited number of commands. After a couple of commands, PLC only reponds NAK signal, like if the sink message is full. I tried to increase inteval time between command transfer, but it still doesn't work. Here is a part of my code: Do Try m_oRS232.Write(m_OutputBuffer) ' Send Command m_oRS232.Read(2) ' Read Response Catch ex As Exception Throw New CDF1Exception("Error 1 SEND COMMAND Function : ", ex) SendCommandV4 = False Exit Function End Try If m_InputBuffer(0) = DLE And m_InputBuffer(1) = ACK Then ' Message received correctly ' Read entire packet Exit Do ElseIf m_InputBuffer(0) = DLE And m_InputBuffer(1) = NAK Then ' Message not received correctly m_NAKCounter += 1 PurgeInputBuffer() ElseIf m_InputBuffer(0) = DLE And m_InputBuffer(1) = ENQ Then ' Message not received correctly m_ENQCounter += 1 PurgeInputBuffer() If m_ENQCounter = 0 Then Try m_oRS232.Write(Chr(DLE) + Chr(ACK)) PurgeInputBuffer() Catch ex As Exception Throw New CDF1Exception("Error 4 SEND COMMAND Function : ", ex) SendCommandV4 = False Exit Function End Try End If End If If m_NAKCounter >= 3 Or m_ENQCounter >= 3 Then Throw New CDF1Exception("Error 5, NAK counter: " + m_NAKCounter + " ENQ counter: " + m_ENQCounter) m_NAKCounter = 0 m_ENQCounter = 0 SendCommandV4 = False Exit Function End If Loop Try m_oRS232.Read(m_ReponseLength) Catch ex As Exception Throw New CDF1Exception("Error 2 SEND COMMAND Function : ", ex) SendCommandV4 = False Exit Function End Try If Buffer.ValidateNextMessage(m_oRS232.InputStream) Then Try m_oRS232.Read(2) m_InputBuffer = m_oRS232.InputStream Catch ex As Exception Throw New CDF1Exception("Error 3 SEND COMMAND Function : ", ex) SendCommandV4 = False Exit Function End Try If m_InputBuffer(0) = DLE And m_InputBuffer(1) = ENQ Then ' Validation correct m_InputBuffer(0) = DLE m_InputBuffer(1) = ACK SendCommandV4 = True Else m_NAKCounter += 1 End If Else ' Validation incorrect, re-send entire message m_InputBuffer(0) = DLE m_InputBuffer(1) = ENQ End If Try m_oRS232.Write(m_InputBuffer) PurgeInputBuffer() Catch ex As Exception Throw New CDF1Exception("Error 4 SEND COMMAND Function : ", ex) SendCommandV4 = False Exit Function End Try Does anyone have a advice or suggestions ?? Best regards. Nicolas Chaillou.
  4. Micrologix 1500 DF1 Protocol Newbie

    Hi Hidroilio Pérez, I cannot understand why the PLC seems not to communicate with me... RsLinx is not running, and my comm Port is correctly open. Whatever the command I try to send, PLC returns me only 0. Maybe the baudrate or parity value are incorrects.. I thougth I had to send a first command to initialize Communication, but I seem to be wrong, so my problem is somewhere else... Unfortunately, I cannot change only a bit like you asked me, I have to send the hole word every time I want to change a bit value. Do you think we have another solution ?? Thanks for your time and your help. Nicolas Chaillou.
  5. Micrologix 1500 DF1 Protocol Newbie

    I just figure it out than every time I restart my computer, PLC is no longer communicating with me, I have to start RSLinx which send an unknown command that enable communication. Down anyone of you guys know if I have to send a specific control word using a AB ML1500, or any activating command ??? Thanks in advance ! Nicolas Chaillou.
  6. Micrologix 1500 DF1 Protocol Newbie

    Thanks !!! I finally made it work using write with three adress fields command !! It was not supposed to work with ML1500, but it does ! I can write on binary table, float, integer and output table !! As soon as I finish it, I'll post it on the forum !! Thank you all !! My best regards. Nicolas Chaillou.
  7. Micrologix 1500 DF1 Protocol Newbie

    Thanks Hidroilio, your message really helped me. I can read using "protected typed logical read with three address fields" command, but it seems to be a little different to wrtie with three adress fields on a ML 1500, and according to Jiri Toman, ML1500 uses logical write with two adress fields instead of three, but I cannot make it work correctly... I think I'll have to do a protected typed file read and write, but I have a few questions: I read on a post that Tag value is received with the open file command, so It's no longer a problem. Filetype fields is not really documented, so I would like to know which Filetype value should I use in order to write on bit table, integer table, input or output table... Is it the same file type value than we need to use to read with three adress fields ? Is there any other usefull command I should implement ?? Thanks for helping. Regards. Nicolas Chaillou
  8. Micrologix 1500 DF1 Protocol Newbie

    Hi Everyone, Thanks for your example, I can send echo commands and perform protected typed logical read, but I'm having troubles reading an output status : O:0/1 I'm working with a Micrologix 1500 under vb.net following AB DF1 protocol This is what I sent : |DST|SRC|CMD|STS| TNS |FNC|bytesize|fileNo|filetype|Ele.no|S/Ele.no| | 1 | 0 | 0F | 0 | 1 | 0 | A2 | 8 | 1 | 8B | 0 | 0 | It returns me: |CMD|STS| TNS | DATA |EXT/STS| | 79 | 0 | 1 | 0 | 0 | 0 | 0 | 64 | 0 | 32 | 0 | 0 | 16 | 3 | May someone help me understanding what Data Field means ?? Thanks you all !! Regards. Nicolas.
  9. Micrologix 1500 DF1 Protocol Newbie

    Thanks Hidroilio, Currently, I can send 100 of echo commands, and I'm trying to read on a binary file. Thanks for help, I let you know If i need more help !! Nicolas Chaillou.
  10. Hi Everyone, First of all I'm new on this forum and glad to become one of yours, there is a lot of informations there and I'm pretty sure this forum will be really usefull for me. As you can see, I'm a newbie in PLC programmation, and I have to write a driver using DF1 protocol for a Micrologix 1500 under VB.Net. I already went on tomantron.com, but according to Jiri, his driver doesn't seem to work with a Micrologix 1500. So, I read the DF1 manual, and I'm currently trying to communicate with the PLC and I'm having a hard time. I'm trying to send an echo command, and It doesn't work at all... Dim s_Tx1As string s_Tx1 = Chr(16) + Chr(2) + Chr(0) + Chr(0) s_Tx1 = s_Tx1 + Chr(1) + Chr(0) + Chr(0) + Chr(0) s_Tx1 = s_Tx1 + Chr(0) + Chr(0) + Chr(50) s_Tx1 = s_Tx1 + Chr(16) + Chr(3) s_Tx1 = s_Tx1 + Chr(90 Mod 256) s_Tx1 = s_Tx1 + Chr(CInt(90 / 256)) moRS232.Write(s_Tx1) moRS232.Write(s_Tx1) it returns me DLE NAK Thanks in advance. Regards. Nicolas Chaillou.