AlexPLC

MrPLC Member
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AlexPLC

  • Rank
    Newbie

Profile Information

  • Country United States
  1. well looking at the Wireshark stream is something I haven't thought of, definitely something to try and take a look at.  I appreciate the responses and suggestions so far..
  2. Hello AB gurus, I am truly grateful for the help from the forum recently on ASCII communication and now I have another general question. In my application the machine is physically mobile and connects to different customers several times a year. In almost all instances the customer is reading in the data from the machine via  serial communication using ASCII characters, but in some cases they cannot or are unable to change their serial settings such as baud rate, data bits, parity, etc. On some other PLC systems in my experience, they allow you to change the serial settings on the PLC without having to go into the settings on the PLC program, change the settings, and then re-download. In other words, any user can go to the HMI and change the serial settings to accommodate different situations; you don't have to get the programmer involved just because you moved to a new customer and they need to read in their data. For the CompactLogix 5069-SERIAL I do not see any way to do this. I do not see them under the "built in" tags under Controller Tags. The only place I see where they can be modified is under the properties of the module itself and of course you have to have Studio 5000, and the PLC will go into STOP mode during this change. Does anyone know that for serial communication in general does the CompactLogix system or possibly ControlLogix system have a serial communication option where the settings are configurable while the PLC is in RUN mode? I have contacted our local distributor's experts and they were unaware of a solution. Thanks  
  3. thanks for the help again BobLfoot,I think it will probably be easier to re-write in ladder so I can possibly use the CLR also.  
  4. hmmm, definitely good point about possible overflow, but since the Tx buffer is fixed at 0-255, shouldn't the 256 always be safe or is it still risky?  it does not appear that CLR is an option in ST language.  I am trying to find an equivalent instruction.....
  5. yes! makes sense, I made a "state machine" Serial_Send AOI that cycles through and clears the stringfinal and transmit buffer every cycle. The syntax on clearing the final string was straightforward using cps, but it was tricky getting to work with the Tx buffer since it is a SINT[256] and not a string   so now the Tx buffer only has what is being sent. Thank you so much for your time, responding to my question and passing the knowledge, greatly appreciated BobLfoot!
  6. Hi again gurus! I am using CompactLogix, 5069-SERIAL card. I am sending a variable length of comma delimited data to the buffer. For the string that contains my data, I send move the length of that string to the "DataLength" parameter of the ASCII module instruction so it only sends out the exact length, so here I have 16 , which happens to be the smallest length for my data and it's working fine, but one thing I notice is that say if the data goes from a high length to a lower length for example from 123.45,12234.45,123.45 to 1.2,3.4,5.6 then I notice the left over characters in the TX buffer, so even though I have 16 , I still have "garbage" left over up to element number 21 Is there an easy way to clear out these unused elements? I have done something similar in Siemens using a FOR loop, but have not worked with this system before and just got to the point where it is working "good enough", but I want to clear this data out. Any help or hint is greatly appreciated    
  7. ahhhhhhhhhh ok! I am liking this now, so essentially the "Source B" integer is acting like a "precision parameter". This is definitely going to work for me. I think I'll package this logic into a block and re-use them on all the real values I have and then use INSERT and CONCAT to put the commas in and at the end will go the EOL characters. This was the key I needed to make this work. BobLfoot, Thank you so much for taking the time to explain this!
  8. okay so with the FIND, I see how this can help me keep track of the decimal as I change from X.X, XX.X, XXX.X..., but from the third and fourth line is where I am still confused This is what I have There is something that I am not understanding about the COP, at this point for a number of X.X, all I want to copy is the X.X and throw away all of the other characters in the decimal, but the length of the "AsciiStringValue" (stringstest[11]) is still 10.   For the fourth statement, what exactly is going on with adding the position of the decimal to the length of the Ascii Display Value? Really appreciate the help so far...  
  9. Hi gurus, I am running Studio 5000 and am building a comma delimited data string to send out via ASCII with the 5069-SERIAL card (CompactLogix). I am more familiar with Siemens on this, and there is a function called VAL_STRG in which you can convert a real to a string and define the precision or how many decimal places it will have (attached). I am unable to find something similar and am scratching my head at how to write something robust enough to accommodate a real number that can have one or two decimal places and convert it to a string that will HOLD that precision throughout the range of the number. I guess for a number with one decimal place I could multiply by 100, convert to STRING, and then insert the decimal place, but it sounds like maybe overkill....? Currently if I bring the real even to a user-defined STRING of say 5 characters, the decimal "moves" as the number grows or shrinks. Any help or hint in the right direction would be greatly appreciated.