Search the Community

Showing results for tags 'unsigned word/bit string [16-bit]'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Found 50 results

  1. Hi All, I am Data Transferring Arrays of WORD's from a HMI to NX PLC. This Transfer may be a variety of data types, Likely just UINT and STRING[20]. It will be Imported to NX as an Array of Word What im trying to do is Populate my Structure from this Array of Word. I can do this by mapping them individually just fine. But i was hoping i could add them automatically. Much like when you assign EthernetIP tags and can link them to a structure and User Offset the Bytes. But i cant seem to Link the Array of Word to the Structure e.g. SENSORS_STORED:=DATA_2_IN; Says its impossible Anyone have any ideas how i could Populate this structure from a WORD Array without manually mapping and Converting Each? SENSORS_STORED.Fixture_ID:=WORD_TO_UINT(DATA_2_IN[0]); For Example is a workable way but is long winded and was hoping there is a easier way Thanks in Advance Dann  
  2. View File Crimson 3.0 Simple String Validation Pattern Matcher I developed this for work and thought I would share. It can be used for input validation and we needed it to enable validation of scanner gun input through the USB port. I also use it for serial input validation. Usage is: pattern.isMatch(input string, input pattern) which will return 1 if match, 0 if not a match I have also included toUpperCase and toLowerCase functions for strings. To use in your project, simply copy the pattern program folder to your project. This can be auto-migrated to crimson 3.1. Pattern string syntax is described in the comments or by clicking the guide button. Worth using this testbed to debug your pattern strings before using in a production environment. The controls and bits on the right side of the test page allow you to tab through your pattern and the string and see what matches each char. You can see a mockup of a real world batch-entry view on the "Demo" page and edit the input fields to try to defeat the validation. If you end up using it, toss a thanks my way if you can. If you find any bugs, please let me know. Built with Crimson 3.0 v707.000, tested in built-in emulator and used on Graphite G07s with both Crimson 3.0 and 3.1 runtimes. Submitter marv_tech Submitted 04/10/22 Category HMI Sample Code
  3. serial input string

    Hi  I'm quite new to plc but very new to mitsubishi.   I have an input string eg G+002.7 which represents a weight. I wish to take in the input string then move/convert to int omitting first char,   On other plc's i have been able to use a modifier like d200[2] then the no of chars. How do i achieve this in gx works3   Any feedback gratefully recieved   Paul  
  4. Version 1.0.0

    14 downloads

    I developed this for work and thought I would share. It can be used for input validation and we needed it to enable validation of scanner gun input through the USB port. I also use it for serial input validation. Usage is: pattern.isMatch(input string, input pattern) which will return 1 if match, 0 if not a match I have also included toUpperCase and toLowerCase functions for strings. To use in your project, simply copy the pattern program folder to your project. This can be auto-migrated to crimson 3.1. Pattern string syntax is described in the comments or by clicking the guide button. Worth using this testbed to debug your pattern strings before using in a production environment. The controls and bits on the right side of the test page allow you to tab through your pattern and the string and see what matches each char. You can see a mockup of a real world batch-entry view on the "Demo" page and edit the input fields to try to defeat the validation. If you end up using it, toss a thanks my way if you can. If you find any bugs, please let me know. Built with Crimson 3.0 v707.000, tested in built-in emulator and used on Graphite G07s with both Crimson 3.0 and 3.1 runtimes.
  5. Hi, I need help finding the length of a string.  I am using an In-sight 9000 series camera with a compact logix 5380 and communicating over ethernet. Unfortunately, the string length is not provided in the AOP, and the barcode length will constantly change. I told to use the FSC instruction, but I cannot get it to work. Thanks 
  6. Extracting Digits of a Number

    Hello programmers, maybe sameone can  help me, i have a number  for example 458 how to extract this number to  digits ? 4 5 8  in Twincat or codesys?   tx!    
  7. Sorry new to working with PLC's,  I am trying to write text to a ST file on an RSLOGIX 500 machine, its for a LED display, I am just trying to update the screen to new texts, it all works I am just having trouble inputting the text properly into the string file. I would like to read about it if anyone can point me to a good document or manual that can explain what characters to use?  I see many posts about using VBA using Excel work on RSLOGIX 500? But would like to know how to do it manually first.  Thank you
  8. Hi all, I am a new user of VB.net on NA Omron HMI, and I need your help to solve a problem. In my case, I have to get a HMI global variable value in VB.net, but the VariableName is in an other variable (string). For example: Var1=4 Var2=6 VarName="Var1" I worked with a "SetVariable" function to modify the value of different variables, but right now I need to read the actual value, in the example values 4 and 6.  Do you have any suggestion?
  9. StartApp Intouch Wonderware

    Dears,  I would appreciate your help on the below matter.  I am trying to send email using intouch scada.  I am using the following command: StartApp "powershell.exe " + par0 + par1 + par2 + par3 + par4 + par5 + par6 + par7 + par8 + par9; par0 --> is the powershell script path par1 --> is the email par2 to par9 are some parameters i would like to send. I checked the power shell script and its working just fine, but when i run the script through intouch it seems that executes a part of the string.  For example: par0 = "PATH_ON_MY_PC/powershell.ps"; par1 = "test@test.com" par2 = " -par1 12"; par3 = " -par2 10"; par4 = " -par3 test"; ... par9 = " -par9 9";   I am only getting first parameter and if i change to this: StartApp "powershell.exe " + par0 + par1 + par3 + par2 + par4 + par5 + par6 + par7 + par8 + par9; I will only get third parameter.  How can I overcome this limitation?
  10. Have been able to exchange data types of BOOL, INT,  DINT & REAL between Omron NJ/NX CPU with Allen Bradley Logix CPU's with Ethernet/IP using the CIPUCMMRead & CIPUCMMWrite instructions. I now have a need to exchange "STRING" variable types. Have tried varions string lengths in the NJ without sucsess. AB default string length is 82 & Omron 256 but I think the difference is the length headder that AB has with within their String Tag type. I know I could convert my strings to an array of bytes & sent them this way, but was looking for a solution to sent them as native strings. Hope someone out there has done this & can share their leg work? 
  11. I have a function that reads ASCII code from a transducer, converts the code into characters and places the characters from the serial buffer into a string. Now, I am trying to convert the value in the string into a 64-bit float number. Any ideas on how to do that on the CCW? 
  12. Dword to Float on FX3GE

    Hello! I have a float number (HEX: 3CA01D0F) in Big Endian. It's 0.0195451062. I get it from the sensor and store it in a double word variable. Could you help me? How can I convert DWord to Float? If i use DFLT instruction, It treats DWord as an integer (1017126159) and just gives me 1.017126 e+009 Thanks in advance.
  13. Hi:         How to use data type Word to perform math function without converting to Int or Uint ?  -----> Error    26    The '+' operator is not supported by WORD data type.     thanks    
  14. Union

    Hello! I am trying to get hold of the bits in a word, i have read that union is the way to go. My problem is that i cant figure out how union works. I have made a union between a word (16bit) and an array(0...15). The way I understood this was that the word now automaticly updates the array so that when the least significant bit in the word should update array[00] and so on. This is not happening. When I monitor the variables I can see the word change, but nothing happens with the array. Have I misunderstood the consept and what should I do to get hold of the bits?
  15. Hello, I'm new to CX-Programming and I could really use your help. I want to make function block that will check the bit status from a word input variable. I made input variable and internal variable array of bool(32) and I thought I can just use the code example: array[1]:=word.1 etc... but it is not allowed in CX-programmer. My goal is rearranging  the bits status from the input word to the output word. I don't need just making the 0 to 1 or otherwise... Thank you in advance.
  16. Hello, CJ2M CPU-32 to IAI motion controller through ethernet/ip I'm working on programming electric actuators to pick up parts from a tray. I will have x (row) and y (column) coordinates that I need to update to move the actuators. So to go through the whole tray I would have to use nested loops. (below what i'm trying to achieve if i was doing it in C++)                                           6 Rows and 6 Columns, palettizing                                           data rows&columns DWORD (Row1,row2,row3...row6; col1,col2...col6)                                           c++ code                                           for i=0,i++,i<6;                                               rowData = row                                               for i=0,i++,i<6;                                                   colData = col                                                   execute movement                                                   wait for confirmation                                               end                                           end I have a way of doing it but it will require a lot of repetitive lines and typing every step, and I was wondering if there is a way on every iteration to increment the data location instead of the contents. In the picture below you can see the example where the goal is to copy data from D8100 to D8000, then in next step from D8102 to D8000, then from D8104 to D8000 and so on. So far in the documentation I was only able to find how to increment contents. Is it even possible to do what I want to?
  17. Hi, As part of developing an EtherNet/IP driver for the CLX family, I have the task of recognising tags that would ordinarily be represented as strings. With SLC/ML, that wasn't too difficult since strings were a pre-defined type found in files with a file type of 0x8d. With CLX, I understand that the situation is quite different, since a string now becomes just another structured tag like so many others. So, for instance, in my controller, and with the help of information gleaned from the LogixTagRead program, I can see that a request sent for one particular tag (which I happen to know is a string) returns me the following information: Tag type: A0 02, followed by, Structure handle: CE 0F, followed by, Length (DINT): 1A 00 00 00, followed by, Data (Series of SINT): 41 42 43 and so on through to 58 59 5A Now in one sense I am fairly clear how to interpret most of the above data -- but in another sense, I don't believe (unless I'm missing something) that it can ever tell me that this tag should be INTERPRETED as a string. What do I mean by that ? Well, the tag type of A0 02 simply says that this tag is a structure (because the top bit is set). Even if we were to unset the top bit, the value becomes 20 02 and I'm not sure if that has significance in itself. I'm not sure if the structure handle (aka template id) of CE 0F tells me anything other than the fact that this is a symbol type of CE 8F. I know that this field can be looked up and will tell me that this structure comprises a C4 (DINT) followed by data comprising a series of C2 (SINTs) where the number of SINTs is given by the value of the DINT preceding. And, of course, this makes sense in that the DINT value of 1A 00 00 00 is decimal 26, followed by 41 42 43 ... 58 59 5A which is a 26-character string ABCDEFGHIJKLMNOPQRSTUVWXYZ. This is all correct. So whilst this LOOKS like a string, how can my code be sure that it is actually to be INTERPRETED as a string ? At the end of the day, it is only a DINT followed by a series of SINT; this doesn't of itself mean it is a string. Is there anything in the tag type or structure handle which actually identifies this as a string-type tag ? Thanks.  
  18. Working with Strings

    Hi so i am learning to work with mitsubishi GX Works2 i am using the simulator, and the help anyway i was testing with strings and when i convert a unsigned word or dword to string it converts it as HEX values and also fill the whole thing with 0's can anyone help me or point me in the right direction with a manual, i do know my way around on AB and siemens but its harder to find help for mitsubishi, on the help for WORD_TO_STR, it says it should be converting to decimal but it isnt, is this a weird bug with the simulator?    
  19. Hi guys, Is it possible to convert integers to/from strings in scripts in GT Designer3? I don't want to perform the conversion in the PLC. Thanks,
  20. i have a third party OPC server transmitting data to 1756-L73-A17 to controller derived tags that i have created in the PLC. all of these tags are working great and retriveving the raw data from the OPC. i have one tag Titled CNA_Last_Measurement_Date_Time, this raw data transmits in the form as the raw data of 43865.7090393519, but i need it to be displayed as 02/10/2020 07:05:39. i have researched all over to find a way to do this either in the PLC or on the HMI and have not found a way to convert the Datevalue numer to a date time format.  this tag changes/updates based on the last CNA measurement that was taken. does any one have a way to accomplish this via the PLC or The HMI?
  21. I am working on  calculating a checksum value for a command that is to be sent from an Allen-Bradley CompactLogix PLC to a Mass flow controller. An example of a command is the following: "@@@022SX!20.00;CHECKSUM".  1. The checksum is the sum of every characters' ASCII code value (starting from character 3).  2.Then this sum (which would be in decimal format) has to be converted to HexaDecimal 3. Finally, the last two characters of the result have to be extracted and that would be the value of the checksum.  (For Ex: the value of every individual characters' ASCII code (starting from point 3) of the above command is 715. in HexaDecimal, 715 = 2CB. So , the value of the checksum for this command would be 2CB) I got to the point where i found the sum of ASCII code. Any idea on how to convert that to  a HexaDecimal and then convert that HexaDecimal to a string so that I could concatenate it to the command string??   
  22. Good day, how can I send string data by buil-in ethernet. Maybe word 'TRIGGER,?
  23. Hello All,                 I am in the process of installing a DPM Scanner to one of our machines.  I am trying to program an ASCII String Compare to compare the scanned part number, stored in a string as ST14:0, to a constant value stored in ST15:13.  I have used this tactic before in other applications and it has worked fine every time, except this time.  Am I doing something wrong?  Is there a setting I am not aware of?  Please see the attached image.  Thanks in advance!    
  24. Barcode string parsing

    Hi all, long time reader first time poster. I am an AB programmer through and through. Recently working on more and more omron gear and need a bit of a steer in the right direction. I have a sick barcode reader communicating to a omron CP1LE PLC over serial. Problem is the value from the barcode reader is not value, it is sometimes multiple values separated by commas (,). I really wish to only have the first value before the comma in this long string stored in D200.  I take it i'll have to move this string into individual container registries which i can easily go from there and pick which one I want to use. But how do I initially go about parsing the string in CX programmer? Attached is a screenshot of what I have so far> Cheers Dave
  25. Hello everyone! Is there possibility to read words e.g. Name of alarm from the csv file or another file and save it in the PLC memory for further processing? It would be the best if the solution will matches to FX5 and IQ-R/F but it can be also for any of them. Thanks for help :)