05-19-2014 11:32 PM
hi
i wanna ask how to multiple request and response on MODBUS RTU using VISA ? i tried to monitoring 2 device digital metering, i made a Labview program to communicate that device alternately using Stacked Sequence Structure, but it only can communicate with 1 device, and the response i think there are some error, the number of byte doesnt match what i request ( 0A04 0000 0002 70B0 )
this is my screenshot
any suggestion ? or maybe use other way to multiple request and response use NI VISA ?
Thanks~
Solved! Go to Solution.
05-20-2014 07:56 AM
Before trying to work with two devices. Start with trying to get one to work.
Nothing jumps out at me at first glance of your VI. But I would recommend using the Modbus Library instead.
05-20-2014 09:09 PM
i did it if just one device and can work correctly, this is my screenshot on 1 device
i wanna try using VISA firstly ( basic serial communication ), next i`ll try modbus library
any suggestion ? am i right using Stacked Sequence Structure ?
Thanks~
05-20-2014 09:13 PM
this is my video, i record the video
https://drive.google.com/file/d/0B_94Z4CwsTYeajlnaTF0bzF0TVk/edit?usp=sharing
05-20-2014 11:21 PM - edited 05-20-2014 11:43 PM
It was pretty tough to see that video.
Obviously in the 2nd frame, the lower comparison was coming out True which meant the False case where stuff happened couldn't execute. (Seems like reverse logic to me.)
Well you check the first two bytes to see if they were not equal to 010A. Well they were because that is the response to the command you send taht started out 010A.
In the first frame it worked because you send out the command starting 0A04, and compare to see it is not equal to 0404, which of course it is not. What is the point of this? It seems like mixed up logic. That you want to confirm it is the correct slave address and correct command (thus they would be equal) in order to execute the decoding code.
The other comparison is pointless also because you are trying to see if the first two bytes are equal to 0A, (no matter which frame you are in) which they will never be because a 2 byte string can never equal a 1-byte string.
By using highlight execution, you should have been able to figure out what was and wasn't executing and why.
Also, you only need one VISA close since you are only opening up one VISA resource.
Really, you'd be better off using the Modbus library.
Here is a much cleaner version of your code using the Modbus library.
05-20-2014 11:32 PM
Buenas noches es que quiero desarrollar una apliacion para mostrar una animacion de una cara que tenga gestos controlables
05-20-2014 11:45 PM
@jorge6904 wrote:
Buenas noches es que quiero desarrollar una apliacion para mostrar una animacion de una cara que tenga gestos controlables
Google:
Good night is that I want to develop an app to show an animation of a face that has controllable gestures
So post in English in a new message thread.
Or a new message in the Spanish forum.
Your question has nothing to do with the thread you posted into.
05-21-2014 04:25 AM
Hi Raven,
i need that to compare, because this digital metering if on Serial Communication using VISA cannot work perfect, see this video, this video when i didnt use comparison.
https://www.dropbox.com/s/st6qs1cbtr72m0m/bandicam%202014-05-05%2015-06-09-546.avi
so on that video i need to compare to distinguish when the data will be processed.
this video when i did with comparsion, work correctly without miss data
https://www.dropbox.com/s/illmc235nn8kv3z/bandicam%202014-05-21%2016-12-36-500.avi
yeah i just realized, compare 0A is useless
Thank you, its work
could you explain me what the function that i circled ? i didnt get it ( Still Newbie on Labview )
and on SFIM metering i think on that device need IEEE 754, and i still studying about IEEE 754
Thanks~
05-21-2014 07:30 AM - edited 05-21-2014 07:58 AM
I didn't wire a constant that was a 32 in my snippet (you can drag and drop that to your block diagram so you don't need to recreate.) Mine was a zero, but it acutally doesn't matter what the constant's value is.
What is important is that the constant has the representation of a U32 integer. It defines what type of wire to convert the incoming array of U16's to a U32.
One possibility is that the data coming in is in the wrong endian order. Which of the two U16's is the most significant and which is the least. You may want to get rid of the typecast and use an Index Array function into two U16 scalar elements. Then use Join Numbers to combine them into a single U32. Which ever is the most significant U16 word will go into the top.
You can also do what I showed, but use the Swap Words function right after the typecast to fix the endianness of the numbers.
All of these functions, typecast, join numbers, swap words, are on the Numeric >> Data Manipulation palette.
05-25-2014 08:15 PM
OK, maybe i need to learn more about this Labview, anyway thank you so much Ravens for your help !!! if i have question i`ll ask you again
Thanks~