Jump to content

SASA

Members
  • Posts

    15
  • Joined

  • Last visited

Posts posted by SASA

  1. Dear colleagues,

    I‘ve project where I need to control two industrial ink-jet printers with UNISTREAM USC-B5-T42. By control I mean sending printing data and listening their reply using TCP Client functionality. In my PLC program I’m activating TCP Client Connect (see picture) with the same TCP Client1, and with different SERVER IP addresses but this isn’t working as I thought it would. I can’t communicate with both printers at the same time which is crucial for this project. I need to receive data from both when they are finished printing the message. Is it possible to use same PORT with two different IP addresses?

    I did the same project several years ago with the V570 PLC and I could use same PORT NUMBER with different IP addresses for two printers. We are distributors of LINX Printing Technologies (UK) and their industrial printers uses fixed PORT NUMBER = 29043.

     Regards!

    27_02_24_IPM_PILA_BCD.ulpr

  2. Dear all,

    We have two V530 PLCs which we can't get alive :) We tried to connect with Visilogic 9.8.90 while it was working to make some changes to the program and after I tried to download it ERROR occured but I didn't write it down. Afterwards I tried to switch OFF/ON PLC while holding finger onto  HMI to get to the STOP menu and then I tried to download new OS but with no luck.  Colleague from Helpdesk Guy Sela tried to help me with the above but with no result.

    Is there any other way to fix OS download problem on V530, some secret procedure ?

     

    Regards,

    Sasa Jovanic

    LOGOKOD d.o.o.

    Croatia

    20200710_163146-800x600.jpg

    20200710_163154-800x600.jpg

  3. 4 hours ago, Saragani said:

    Well, for start, I can assume that you want to replace more than one character, and not only / with Ž, and you repeat the Find and Replace in "BUFFER HEX Rx" data length times.

    Lets assume that your buffer length is N, the number of characters you want to replace are M.

    For each characters, you do N replaces, and the Find and Replace searches for the character in the input array, so in the worst case scenario, the Find and Replace goes over all the characters / array members on each iteration.

    This means that the complexity is N*N*M, which is O(N^3).

    I would do it differently.

     

    I would iterate on the "BUFFER HEX" using a loop (using Jump to Region), from index = 0 to Rx data length, and I would use Load From Array for reading the INT8 value from a specific index on the array.

    Then I would use a Lookup table in order to get the new INT8 value I need to place.

    By Lookup table, you can use a Data Table with 128 rows (The struct will contain INT8 member), or just an array, so on each index of that table / array, I place the correct value, for example, for the Letters A to Z and the numbers 0-9. I place their ASCII value, and for row number 47 (which is the ASCII of /, I place the value of 142, which is 0x8E, the ASCII value of Ž).

    And you can optimize the code, don't try readying the value from the Data Table, of the Value is from the range of A-Z and 0-9 (65-90 and 48-57), and if the Value you read from "BUFFER HEX" is 0, then stop iterating, since it's a Null (end of string).

    This code has a complexity of O(N)

     

     

    Furthermore, just like you used Copy Buffer to Tag, and placed "BUFFER HEX", then you can do the same thing with Copy Tag to Buffer.

    When you select "BUFFER HEX" in the "Copy tag to Buffer", then it automatically adds a [ since this tag input accepts both arrays and simple tags like INT8, so if you delete the last [, and press Enter, then it would accept the expression.

     

    // EDIT:

    I see that you are also repeating the find and replace on each cycle and you don't even want for the data to arrive.

     

     

    Here is an updated version of your project.

     

     

    proba1.ulpr

    Hi Saragani,

    The program works very nice. Thanks again !

    Sasa

  4. 2 hours ago, Saragani said:

    Well, for start, I can assume that you want to replace more than one character, and not only / with Ž, and you repeat the Find and Replace in "BUFFER HEX Rx" data length times.

    Lets assume that your buffer length is N, the number of characters you want to replace are M.

    For each characters, you do N replaces, and the Find and Replace searches for the character in the input array, so in the worst case scenario, the Find and Replace goes over all the characters / array members on each iteration.

    This means that the complexity is N*N*M, which is O(N^3).

    I would do it differently.

     

    I would iterate on the "BUFFER HEX" using a loop (using Jump to Region), from index = 0 to Rx data length, and I would use Load From Array for reading the INT8 value from a specific index on the array.

    Then I would use a Lookup table in order to get the new INT8 value I need to place.

    By Lookup table, you can use a Data Table with 128 rows (The struct will contain INT8 member), or just an array, so on each index of that table / array, I place the correct value, for example, for the Letters A to Z and the numbers 0-9. I place their ASCII value, and for row number 47 (which is the ASCII of /, I place the value of 142, which is 0x8E, the ASCII value of Ž).

    And you can optimize the code, don't try readying the value from the Data Table, of the Value is from the range of A-Z and 0-9 (65-90 and 48-57), and if the Value you read from "BUFFER HEX" is 0, then stop iterating, since it's a Null (end of string).

    This code has a complexity of O(N)

     

     

    Furthermore, just like you used Copy Buffer to Tag, and placed "BUFFER HEX", then you can do the same thing with Copy Tag to Buffer.

    When you select "BUFFER HEX" in the "Copy tag to Buffer", then it automatically adds a [ since this tag input accepts both arrays and simple tags like INT8, so if you delete the last [, and press Enter, then it would accept the expression.

     

    // EDIT:

    I see that you are also repeating the find and replace on each cycle and you don't even want for the data to arrive.

     

     

    Here is an updated version of your project.

     

     

    proba1.ulpr

    Dear Saragani,

    Thank you for your help. Frankly I'd never go that way you did :) 

    I'll test the program right away.

    Sasa 

  5. 14 hours ago, Saragani said:

    Can you upload an example project and tell me where (which rung) you are stuck at?

    I'm having trouble understanding what works fine and what's not.

    Dear Sarangi,

    As mentioned I was playing with byte replacement but I don't know how to send array. In Rang 2 I Find & replace / with Ž integer. but I don't know how to send this array through TCP Server Tx, or how to do Copy Tag to Buffer of this Array. I can only do this with STRING but when I work with Strings I can't replace / with Ž character. I was testing this with Hercules (sending and receiving data over TCP).  The program is little bit messy because I'm in testing  phase,

    Sasa 

    proba1.ulpr

  6. 10 hours ago, Saragani said:

    The ASCII string that used by the UniStream is 8 bits ASCII.

    Making your camera convert Ž to # is wrong since # is mapped to characters that are below ASCII code 128. This means that you will not be able to distinguish between Ž and # because both will be converted to #.

    Can't the camera output Unicode?

    If it's only able to output ASCII, then are you sure it is 7 bit ASCII? Because then I cannot see how can you output any Croatian characters. (And I'm not seeing the point of outputting 7 bits ASCII, since each character still takes 1 byte, so the extra bit becomes pointless).

      

    Hi Saragani,

    The project is to read car registration plates which has standard alpha numeric characters, there won't be #$&/,...that's why I can teach Croatian characters as suggested. I played little bit with Unistream 7" PLC and I'm stucked with TCP Buffer function where I convert Buffer to Tag (INT8) and then find & replace in INT8 ARRAY character / to hex value of letter Ž (8E). This works fine but I don't know how to convert Tag to buffer INT8 array ?

  7. 10 hours ago, Saragani said:

    The ASCII string that used by the UniStream is 8 bits ASCII.

    Making your camera convert Ž to # is wrong since # is mapped to characters that are below ASCII code 128. This means that you will not be able to distinguish between Ž and # because both will be converted to #.

    Can't the camera output Unicode?

    If it's only able to output ASCII, then are you sure it is 7 bit ASCII? Because then I cannot see how can you output any Croatian characters. (And I'm not seeing the point of outputting 7 bits ASCII, since each character still takes 1 byte, so the extra bit becomes pointless).

      

    This is Cognex answer:

    OCR Max only supports the 7 Bit ASCII table. 
    What can be done, is to "translate" Croatia characters into characters of the 7 Bit ASCII Area. In general you can teach the OCR-Tool every sign you want and tell it is a e.g Č as # 

    Afterwards you can "decrypt" this translation in your PLC, in a script or somewhere else.

  8. 19 hours ago, Ausman said:

    Was simply wondering if there might be a setting within the camera itself to alter what comes out of it in the serial stream.  Perhaps there is a particular internal setting that will give you a more conventional ASCII stream.  And that program "In-Sight Explorer...." appears to be the one that lets you access the camera's innards/settings.  If this is possible it will save a lot of trouble.

    cheers,

    Aus

    Dear Aus,

    Unfortunately it is not possible, INSIGHT only operates with ASCII 7 bit characters. that is why I'm trying to work around it.

     

    Sasa

  9. Dear colleagues,

    I've one project where I need to read from TCP/IP port ASCII string from COGNEX Insight 7200 camera data. We are reading standard ASCII characters but also we have CROATIAN characters which are not represented in ASCII (ČĆĐŽŠ). I decided to use UNISTREAM 7" PLC for this purpose but I'm stucked with the way how to do this, I'm new to the UNISTREAM. I red in forum that we can use function COPY BUFFER TO TAG but when I do that I got ��਍.

    I can teach COGNEX camera to save font Ž as # for example, so if camera reads PŽ1234, it will send  ASCII string P#1234 to PLC. At PLC side I need to convert # to Ž and then compile it to original state PŽ1234 and send it to SERVER.

    Can anyone help me with this ?

    Regards,

    Sasa Jovanic

    LOGOKOD d.o.o.

    Croatia

  10. Hi all,

     

    I just started up V430-TR430 and tried to download PTO program from VISILOGIC examples files (PTO). I changed in hardware from V350 to V430 TR34. After reboot PLC stucked on black screen with bellow error ?!

    I tried with V430-TRA22 model configuration (although I have TR34) and then it works ? So my question is can anybody help me with this, what can I do to make it work ?

     

    Regards,

    Sasa Jovanic

    LOGOKOD

    Croatia

    v430.bmp

×
×
  • Create New...