Codepark Posted March 4, 2021 Report Posted March 4, 2021 Using sysmac studio, i get 4bytes binary data Data[24], Data[25], Data[26], Data[27] like this, the problem is that the 4bytes data represent my float data what can i do with that 4bytes lol If u see below images you can understand my problem.... thank you all,
Codepark Posted March 4, 2021 Author Report Posted March 4, 2021 Thanks for reply :) if arrbyteto function exist, it would be easy lol
IO_Rack Posted March 4, 2021 Report Posted March 4, 2021 7 minutes ago, Codepark said: if arrbyteto function exist, it would be easy lol It does exist. What controller are you using? What is the Keyence device? Is this EtherNet/IP? 1
Codepark Posted March 4, 2021 Author Report Posted March 4, 2021 (edited) 38 minutes ago, IO_Rack said: It does exist. What controller are you using? What is the Keyence device? Is this EtherNet/IP? thanks million again god bless the america actually i am new in this company for the freelancer job and i am used to web/app development lol dealing with this machine friendly code make me come back school lab haha... last, respect for the knowledge of this old-fashion, neccessary-evil language, hard to draw idea AryByteTo Keyence Device : lj-x8000e controller : nx blabla? and yes its EtherNet/ip connection using modem https://www.manualslib.com/manual/1206594/Omron-Nj501-1500.html?page=506 gosh this make me feeeel soooo comfort.... thanks millionnnnn do u have any problem doing some work or other part lol will help u whatever i can do... thanks again!! ah can u recommend some ways to study dealing with sysmac studio with stl language? Edited March 4, 2021 by Codepark
BE Posted March 4, 2021 Report Posted March 4, 2021 (edited) 4 hours ago, Codepark said: can u recommend some ways to study dealing with sysmac studio with stl language? I have found the help menu in Sysmac Studio to be quite thorough. If you are trying to work out how to code a particular function/function block, find it in the help menu, and have a look at the structured text examples for that function/function block. If you are referring to some sort of reference material for ST coding generally, I haven't found anything comprehensive yet. If I have a specific problem that I can't find in the help menu, I normally check the forums and/or contact my Omron tech. Edited March 4, 2021 by BE Spelling 1
Crossbow Posted March 4, 2021 Report Posted March 4, 2021 www.omronlearning.com for some basic intro to Sysmac classes... Omron also offers in person and virtual training classes. 1
panic mode Posted March 4, 2021 Report Posted March 4, 2021 its been really long time since i had access to Omron but... there may be (should be) option to use union. basically it is a special construct that has more than one variable type of same size. so in this case you could create one with 32bit data exposed as both integer and float. then you can write the integer (4 bytes) and read other (float) or the other way around. it is really just bit-by-bit copy but with different data type. 1
Crossbow Posted March 5, 2021 Report Posted March 5, 2021 Union only works with BIT, BYTE, WORD, DWORD, LWORD. Not Integer or Float. 1
photovoltaic Posted March 5, 2021 Report Posted March 5, 2021 You're better off looking at the Ethernet IP manual for the device you are communicating with and creating a structure that matches it and using that as your EIP variable. a byte array is a good way to test comms quickly and check that you are getting data from the EIP device but it is much easier to make a structure than convert every byte(s) into the necessary data you're trying to work with. Programming -> Data -> Data Types -> Structures Create a new one that matches the instance you are reading, should be well documented in the manual for the target device 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now