Modbus register readings, double type Shared Variable 32000

Hello
I am new to labview and modbus and have been trying to communicate with a control card using the VIs in the standard modbus library in labview 8. This might be a very simple question, it relates to the output of the "read holding register" or "function code 0x03" . All the results I have been getting are in 5 digit decimal form, I have read in another post that this may be the "double type Shared Variable" and that it can be converted or typecasted to "ieee 754 type" i.e. as actual measurement values. I was wondering if it is possible for 5 digit "double type shared variable" that are greater than the 32000, i.e such as 50119 or 50294, to be converted to "ieee 754 type". Or even if there are standard methods that can perform this type of conversion in general.
Thanks in advance

Maybe this will help.
http://forums.mrplc.com/index.php?showtopic=30
http://www.simplymodbus.ca/FAQ.htm#Types
What are data types?
The example for FC03 shows that register 40108 contains AE41
which converts to the 16 bits 1010 1110 0100 0001
Great! But what does it mean? Well, it could mean a few things.
Register 40108 could be defined as any of these 16-bit data types:
     A 16-bit unsigned integer (a whole number between 0 and 65535)
                    register 40108 contains AE41 = 44,609 (hex to decimal conversion)
     A 16-bit signed integer (a whole number between -32768 and 32767)
                                                        AE41 = -20,927
              (hex to decimal conversion that wraps, if its over 32767 then subtract 65536)
     A two character ASCII string (2 typed letters)
                                                        AE41 = ® A
     A discrete on/off value (this works the same as 16-bit integers with a value of 0 or 1.
                                              The hex data would be 0000 or 0001)
Register 40108 could also be combined with 40109 to form any of these 32-bit data types:
     A 32-bit unsigned integer (a number between 0 and 4,294,967,295)
                             40108,40109 = AE41 5652 =  2,923,517,522
     A 32-bit signed integer (a number between -2,147,483,648 and 2,147,483,647)
                                                       AE41 5652 = -1,371,449,774
      A 32-bit double precision IEEE floating point number.
      This is a mathematical formula that allows any real number (a number with decimal
       points) to represented by 32 bits with an accuracy of about seven digits.
                                                       AE41 5652 = -4.395978 E-11
      Here is a spreadsheet IEEE float calculator for inputs of 4 bytes or 2 words.
      To download a copy, right click and select Save Target As...
     A four character ASCII string (4 typed letters)
                                                         AE41 5652 = ® A V R
More registers can be combined to form longer ASCII strings.  Each register being used to store two ASCII characters (two bytes).

Similar Messages

  • Modbus Ethernet read and write to a Eurotherm 6180XIO Modbus server using LV8.2 shared variables

    I am having EXTREME difficulty trying to establish communications with a Modbus device using LV8.2 shared variables.  The device is a Eurotherm 6180XIO Datalogger configured as a Modbus master.  The PC and a cFP-1804 are slaves.  All IP addresses are set correctly.  This approach using shared variables would seem simple, but I can't find any examples or proper guidance on how to get it working.  I am trying to avoid having to mess around with TCP/IP, OPC, or any other old-fashioned method.
    I have read many threads on related topics but none directly apply to this situation.  I have created a library containing a Modbus I/O server and shared variables bound to read and write holding registers.  I have followed all recommended tips for creating such variables but I can neither read or write data.  All data types are U16 due to Modbus protocol limitations.  I have also applied the LV x10 factor in the most significant digit in the register offset (6 digits instead of 5).
    I have a cFP-1804 on the same network which reads into the datalogger OK.  The registers I use are 31000 (for CH0 on module 0, 31002 for CH1, etc) and the data can be read as FLOAT32.  I have updated the firmwate on the 1804 to the latest level.  I cannot even get shared variables to read SGL values.  Using registers 301001 for CH0 and 301002 for CH1 I can only read U16 values, and not a 2-word SGL.
    Third party Modbus simulation software is able to write to and read from registers very easily, but not LabVIEW.
    Some questions are:
    - do I use a Modbus master or slave as an I/O server in the library as a target for binding the shared variables?
    - is there some other wierd translation in register offsets between LabVIEW and traditional Modbus?
    - is this actually possible using shared variables or am I wasting my time?

    Sending the whole 60-character string using a string or array would be the most efficient.  I have tried both methods, and these only cause the datalogger to flag a message log but no text is displayed.
    For a string variable, I have used the following binding "My Computer\Modbus Test.lvlib\ModbusServer6180\442305", where ModbusServer6180 is a Modbus I/O server configured with the logger IP address, and 42304 is the register offset at the start of the text block in the logger.  I need to write to 30 consecutive registers starting with this one.  I am not using buffering and have not enabled single writer.
    Can anyone confirm whether this method should work in 8.2?
    Does the string need a special termination character?

  • Why string type shared variable takes more time to update in the client

    I am using shared variables to share the data across a master and the client PCs connected in a network. (Network published & no buffering)
     I have created an integer type shared variable(I32) and a string type shared variable (data size is 60 bytes) in the Master and subscribing to the same in the client PCs. In the master PC, I am modifying the data in this order - update the data in the string type variable and then update the data in the integer vaiable.
    But in the client PCs, due to the size difference in the variables, I am receiving the data of the integer first and after that about 3-4 sec later only I am receiving the string data. Can any optimization be done to reduce this latency period? Instead of the string data type any better data type will reduce this delay?
    Please suggst. Advnced thanks.

    Latency has a lot to do with your network.  3-4 seconds is a long time though.  This could also be due to the larget data size of your string.  The integer data size is definitaly not 60 bytes.  If you're looking for better performance, I would highly recommend looking into Datasocket communication or TCP/IP communication.  (There are shipping example for both.)
    When it comes to performance of throughput and efficiency, network-published variables are lower on the totem pole.
    I hope this helps,
    Kevin S.
    Applications Engineer
    National Instruments

  • 2D double array shared variable in real-time application

    Hi,
    I am using Labview 8 and I created a real-time application using shared variables. Is it possible to create a 2D array of double (I don't find how to do itdirectly). Probably I can define my own control and load this control as the custom data type of my variable. But is it recommended to do that?
    Thank you
    Alexandre Boyer

    Another way to do this is to specify your shared variable to be a custom control and create a control that simply has a 2-D array in it.  I've attached a zipped LabVIEW 8.2 project that shows both methods.  Enjoy!
    Becky
    Becky Linton
    Field Engineer - Michigan
    National Instruments
    Attachments:
    2DArraySharedVariable.zip ‏110 KB

  • Modbus I/O Server Shared Variable Not Updating Immediately After Flush

    Hi everyone,
    Weird issue here... If I create a Modbus I/O server in a LabVIEW project, bind a shared variable to a holding register, write to the shared variable, flush, and read back, the value returned in an immediate readback is NOT the value I previously wrote. I've attached an example snippet.
    In this example, PLC Command Complete is TRUE coming in. I write a FALSE to it. I flush the shared variable buffer. I read back PLC Command Complete. When I do this, PLC Command Complete will return TRUE (???), and after 100ms or so, return FALSE. How is this possible??
    Some notes:
    The shared variable is NOT network buffered.
    The slave is NOT altering the value of this variable; only this snippet of code is.
    Altering the refresh rate of the Modbus server does not affect the outcome.
    If anyone has any idea as to what's going on, I would greatly appreciate it!

    Couple of points.
    First, your screenshot shows network shared variables, not single process!
    Next, network shared variables take time to update (much longer than NI tell you!) If you knock up a little timing noddy to set a variable and then loop reading that variable until the transition comes through you get results like this (runnng from the programming environment, I've not tried with a compiled exe):
    Network shared variable, no flush - approx 20ms (NI say is should be 10)
    Network shared variable, flush buffer - very fast (faster than the ms clock resolution) but still took between 14 and 20 iterations of my loop before the change percolated through (certainly not what you would expect)
    Single Process variable - instant (even without the flush)
    This has caused me so many problems in the past (my own race conditions are bad enough without NI throwing in extra ones with this unexpected behaviour) that I try to avoid network shared variables now.
    Change yours to single process and you should be fine (or do they need to be NS?)

  • Custom data type causing trouble in deploying shared variable to RT target

    I seem to be having some difficulty in using a network published shared variable created from a custom data type when deployed as an executable on an RT cRIO target.  I'll start by describing why I believe this is where the problem lies.  I created my RT VI in the LabVIEW development environment (LV 2012) and everything works fine.  This VI is pretty simple because it rapidly devolved in to a debug exercise.  The RT VI starts by simply blinking the User LED a couple of times and then starts a simple acquisition loop to read a few values off the hardware using the scan engine (while still blinking the User LED).  After reading the hardware, the values are bundled in to a cluster and written to a network-published shared variable defined by a type def custom control.  The custom control contains five dbl precision floats.  If it matters, the cRIO RT system hosts the shared variable in this case.
    So, I deploy this under the development environment and everything works fine.  The LED blinks merrily along, telling me that the program is running properly.  Running a host VI that reads the network-published shared variable yields the desired result.  All is good.
    Now I want the cRIO system to run this simple program autonomously at startup.  I build it, set it as the startup VI, deploy it and then restart the cRIO target.  The LED never starts blinking... the VI does not seem to run.  I will spare you most of the debugging work and jump to the end.  I basically "Diagram Disabled" various sections of code until the VI started running correctly as an executable.  I kept reducing the size of the disabled code until only one thing was disabled:  the write to the custom data type shared variable.
    So, I guess my question is this:  Are custom data types defined by type def'd custom controls allowed in executable RT programs?  I've read through the cRIO Developers Guide, my NI Real Time Development course book and the Using Shared Variables white paper and I didn't see anything that forbade it.  I know that there are some things not allowed in executables that are allowed in the development environment (front panel property nodes, dialog VIs, OS-specific calls, etc), but no mention of custom data type shared variables.  Any ideas as to why my VI runs in the development environment but fails when compiled unless I remove the write to the network published shared variable?
    Thanks in advance for your help!!
    Solved!
    Go to Solution.

    Paolo,
    So I thought that you meant to disconnect them in the build specification.  Under the Additional Exclusions in the build specification, there is a check box for Disconnect Type Defs.  I checked that box, recompiled, redeployed and it did not work.  At this point I had to give and move forward, so I was going to convert the data typed from a cluster to an array.  When I went in to change the data type in the shared variable pop-up from the project explorer, there was a big button under the variable definition that "Disconnect from Type Def".  Clicked that button, recompiled, redeployed, restarted and everything worked great.  Thank You!!
    I suspect that I'll have to be careful if I change the definition of that data type (add an element, etc) since it is no longer connected to the data type.  We'll cross that bridge when we need to.
    Thanks again

  • Modbus I/O server & Shared Variable Engine

    小弟做專題用到Labview,想請教一個問題,目前是用labview對智慧電表讀取資料
    主要用modbus I/O server(TCP/IP模式)和shared variable engine
    但是網路上大多數資料是教學如何建立I/O server和設定shared variable
    小弟想知道背後理論是什麼?
    例如:labview如何對modbus TCP/IP的封包進行處理,並取出所要資料。
    謝謝各位指教

    建議使用 google
    關鍵字 = labview shared variable concept

  • How to add a new Shared Variable programmatically to an existing and deployed library?

    Hi there!
    I am trying to accomplish this on both LabVIEW 8.6 and LabVIEW 2010 and seems like it's not any different in this situation.
    My case: A project has a library with 4 Shared Variables (SVs). The library and the variables are deployed (visible in Distributed System Manager 8.6/2010). I want to add 2 more variables into this library. It is possible to do this manually from Project Explorer window's options menu. But while running an application it has to be done programmatically. Can I provide the library reference to the one currently existing without creating a new one?
    "Create Or Add Library To Project" function in the Datalogging and Supervisory Control (DSC) toolkit does not help in this case. That function, as the name suggests, just tries to create a new library in the project.
    Two possible methods:
    The function "Add Shared Variable To Library" (DSC>EngineControl>Libraries & Processes) needs a library reference, which could be provided via "CreateOrAddLibraryToProject" function, but this function tries to create a new library, and if I provide the path of the existing library it throws an exception that the library already exists in the project (yes, as I wrote above, I need to add new variables to an existing and deployed library).
    OR
    The function "Create Shared Variable" (DSC>EngineControl>Variables & I/O Servers) will add Shared Variable in a process, and not physically in a library file, and the problem (limitation) with this approach is that it doesn't allow to add complex data type Shared Variables (for example in LabVIEW 8.6 it has only 4 datatype options in input parameter, and even in LV2010 it does not have "Image" datatype that I need).
    The scond method is my preferred method as it allows to work on Online Shared Variables and doesn't create them physically in libraries (and this is good as the variables' scope remains only till the Variable Engine is running). But it doesn't support advanced data types, and the first method is powerful in terms that it supports to virtually any datatype, it just seems tricky to get that reference to the library.
    Any tips?
    Thanks ahead!
    Vaibhav

       <<<<>>>>   
    As the above two images show, while a library does not exist, it is easy to use the "CreateOrAddLibraryToProject.vi" which will add a new library to the project (if it doesn't exist on file system, a new library will be created) and that way, using the reference (the green wire going out from the function and the Case Structure, can be used to add Shared Variables to the library. The problem was what to do when a library already exists in the project, how to add more variables to it. I was looking for a way to get a library reference, and somehow I could not see it inside a Project's property (VI Server functions). Hence I posted the question. And upon continuing my search, I found it on the Application's property list.
    I hope it was useful for someone else as well. And thanks for the replies. Please share a better idea if you have.
    Vaibhav

  • CFP-1808 shared variables timestamp

    Hi,
    I need to control and acquire data from a cFP Ethernet module (cFP-1808) to a PXI RT system. I have tested two ways of doing it:
    1. Bind shared variables to the Fieldpoint channels. Works great except for the fact that I have to record the timestamp of every single channel in all Fieldpoint modules. I have to avoid this. The reason I have to record all timestamps is that sometimes two consecutive reads are the same in value and in timestamp; so even if I make sure I get a value every 100ms in my real time application I cannot trust  that  the shared variable engine will give a real new value every 100ms, because sometimes one read is the same as the previous one. My
    understanding of the technology is that the cFP network interface checks for an
    updated value of the channels of each module at the Advise Rate. If there’s a
    new value the cFP transmits it to the Shared Variable Engine running in the PXI
    controller, but if the value has not changed it doesn’t transmit anything, so
    more efficiency is achieved in the network communication. This would explain the
    timestamp behavior of the shared variables bound directly to Fieldpoint
    channels; since there is no new value the shared variable is not updated so the
    timestamp of two consecutive reads is the same.
    2.  Create a Modbus server and then create shared variables bound to the Modbus server channels. With this method any time my RT application asks for a new value the shared variable engine provides a real new value with an updated timestamp, and all timestamps in the same module are equivalent (in 1usec range).  Therefore, it looks like using the Modbus solution I  only have to record one timestamp per module.
    So option 2 probably fixes my problem, but I'd like to understand why. Both methods use the shared variable engine, shouldn't they behave the same way? There's one downside in option 2, which is having to deal with Modbus addresses and not having the ease of use of option 1 that just browses to find the Fieldpoint channel.
    Any comments?
    A final note, it'd be great to be able to use the Fieldpoint VIs in LV Real-Time! Can this be achieved?
    Raimon

    Hi Raimon,
    How are you binding to your shared variables?  This KB reviews three methods:
    http://digital.ni.com/public.nsf/allkb/FA610367EC62574186257118005089F2?OpenDocument
    I don't believe using FieldPoint VIs on a PXI RT target is possible because FieldPoint is not a driver that you are able to install on the PXI RT target.  We do have the cFP-2xxx line of RT controllers for FieldPoint, which can communicate directly to the FieldPoint modules, ensuring determinism.
    Trey B
    Applications Engineering
    National Instruments

  • Datasocket and Shared Variables

    I am curious if there is any advantage to using Datasocket to read/write shared variables (as opposed to a direct read/write).  I'm specifically talking networked shared variables here.
    Is there any speed advantage to accessing shared variables thru the Datasocket functions?  Since both a direct read/write and a Datasocket PSP read/write talk to the same variable engine I assume they are equally efficient but I'm looking for confirmation here.  I've seen benchmarks for shared variable performance but none of them use DS/PSP to access the variables.
    Normally I would not even think of using Datasocket to access shared var's but where I currently work we have a large app that does this and it works great.  I suspect that this functionality only exists in LV8.x for backward compatibility and non-Windows OS compatibility and is not really meant to be used for new, Windows-based apps?   Am I off base on this?
    I am working in LV 8.5, BTW.....

    Hello Jared,
    Thank you for the reply with clarification. 
    Based on your comment, I changed the buffer parameters and also tried the programs with two different data types, previously StringArray and now String.
    In the attached LV8.6 project, you have all the programs, and shared variable library to review my tests. 
    There are two sets of two files - each set has a Write Shared Variable and Read Shared Variable file. One set is for StringArray type Shared Variable (named StrArr in the library), and the other set is for String type Shared Variable (named Str in the library).
    String Array example:
    MultipleDS-Write-SharedV-StrArr.vi / MultipleDS-Read-SharedV-StrArr.vi
    In my String Array shared variable, I use only 4 element array, each having 4 character strings - meaning 16 bytes per String Array data. I have two loops in the write file, writing to the same variable, an array of 4 strings, each loop continues until the loop index is >0. This means, sometimes, depending on the processor speed, the variable will be written 3 times or 4 times (the variable could have a new value before the loop condition is checked).
    So this means, if I have buffer of 100 bytes (16*4=64<100), it's enough for 4 such arrays (of 4 elements, each element with 4 characters) could be buffered to have sufficient time at the client (Read) program to read them. 
    I am putting 2048 bytes in buffer, which is much more than sufficient in my case. 
    The writer loops run with 200 ms to wait for each iteration. The reader loop runs with 100 ms in DS timeout and 100 ms in wait timer. This gives results without any loss. However, if I run the reader loop with 1000 ms to wait for each iteration, the data is lost. The buffer is not maintained for 2048 bytes.
    In the read program, just to make sure if all data is read or not, I am showing data in two different string indicators, showing data of each loop.
    String example:
    MultipleDS-Write-SharedV-Str.vi / MultipleDS-Read-SharedV-Str.vi 
    The String Array shared variable didn't show values in the Distributed System Manager. Hence, I created another simple variable with String datatype.
    The writer program writes strings of 4 characters, one-by-one, in two loops. Meaning, total 8 strings of 4 characters each are written in the "Str" Shared variable. 
    The reader program, however, doesn't always display all the 8 strings. Although the wait timer is not high (slow) it still misses some data usually. Data is overwritten even before the buffer is filled (in buffer, I have defined 50 strings with 4 elements in each).
    In both of the Read programs, I read using datasocket. I think thought datasocket has more ability to buffer. Earlier I had "BufferedRead" in DataSocket, which I have changed to just Read, because BufferedRead didn't give any special buffer advantage in the Shared Variable reading.
    ---- This is an update on the issue. 
    Ok, just while typing the last paragraph above, regarding datasocket, something clicked in my mind, and I changed the DataSocket functions to simple Shared variables (completely eliminating datasocket functions) in the read programs as well. And bingo, the buffer works as expected, even if I have reading loops very very slow, there is no data loss in any of the program sets. 
    The two changed Read programs are also included in the attached project - MultipleSV-Read-SharedV-Str.vi and MultipleSV-Read-SharedV-StrArr.vi
    So this means, I can completely eliminate DataSockets (not even using PSP URLs in DataSocket Open/Read functions) from my programs. 
    One question here, what will be an advantage of this (or any side effects that I should be keeping in mind)?
    Vaibhav
    Attachments:
    DataSocket.zip ‏71 KB

  • Polling variables using Modbus IP and labview 8.2.0 shared variables

    I'm using shared variable in order to read/write register on a Watlow PM controller over Modbus IP standard. Once I make a change to FP control, the shared variable polling starts and I no longer get update of any controls or indicators on the FP.
    Just wondering if this is an LV 8.2.0 issue and if any of this is addressed in LV 8.5?
    Thx ahead of time
    richjoh

    Hi richjoh,
    If I understand correctly, there are two issues to address: the status of the UpdateNow shared variable and the fact that your controls and indicators are not updating. 
    When you right-click on UpdateNow in your project and select Properties, what is the data type listed there?  Is it bound to one of the other shared variables that has a value in Variable Manager?
    After changing a control on the front panel, do you continue to see the values changing in Variable Manager even though the controls and indicators do not update on the front panel?  Do you see the same behavior regardless of which control you change? 
    Thanks for the additional information. 
    Jennifer R.
    National Instruments
    Applications Engineer

  • Modbus ip shared variable network failure

    I am using lab view 8.6 DSC module to communicate to a watlow system which contains five watlow 96 controllers and an EM gateway.  I have created shared variables for the process temperatures and setpoints for each of the five controllers using watlow modbus register Numbers with a 400001 offset.  I have also created shared variables for Updating,CommFail,UpdateNow,and UpdateRate which where predefined. I have error when starting the VI if the SV  has been  dragged and dropped into the block diagram. The message is  Error -1967353902 (The Modbus I/O server failed to receive any response from the Modbus slave device.) occurred at SV in vi. If I bind a variable in the VI to this same SV the error does not occur but the variable cycles between Good, Network Failure, No known value, and device failure as stated in the variable manager watched variables.  The Updating, CommFail and UpdateRate all have a consistent Good in the quality column of the variable manager.  UpdateNow has X in value, type, timestamp, and quality columns.  CommFail and Updating does cycle between true and false randomly.  I have tried a third party software called SpecView 32 demo to see if the commincation with the modbus system is not working and I can create five watlow controlers on my screen and direct them to the ip address along with a unit address and the system works without faults.  This leads me to believe the commincation bewteen the SV Engine and the IP address is not correct.  HELP Please. 
    Robert Jensen
    UND EERC

    If your application can deal with it I would recommend staying clear of the 'Networked Published' option.
    When I started my Modbus development on cRIO....I left it enabled, and with ~100 shared variables on a 9074, the CPU was railing, and I saw a buffering behavior on the shared variables (which was not desirable in my application).
    In my application I am using the old modbus library (as apposed to the new API) for cRIO to slave comms, the cRIO being the master.
    I am also using the IOserver making the cRIO a slave to an external SCADA - and it passes essentially the same data arrays as I use on the modbus library for my local HMI [Not an NI product].....Which is two full Modbus frame writes (@ 120 words each, and about 60 words more for ~300 words outbound from the cRIO).
    The IOserver slave was a recent addition and did not add much to the CPU load - although only 16 bytes is high speed, the balance of the total word package is at either 1 second or 3 seconds.
    So, in my experince, the 'Networked Published' option adds significant CPU loading (on entery level cRIOs) YMMV.
    I am huge fan of the shared variable engine (some at NI were pusing the CVT, and TCE etc...). However most of my shared variables are not the Networked Published variety (excepting local module channels) those have remained networked published for DSM (Distributed System Manager) use.

  • Problems writing to network published shared variable hosted on rt (set as modbus slave for crio)

    Hello Ni Forums
    This is my first post on this forum and I have been using labview for about 8 months now
    I have a problem regarding writing data to modbus registers through an i/o server set as a modbus slave for my 9074 hardware.After I have completed building project and deploying the variables and following instructions from here , it yields no result but a line zeros. I have the Ni DSM open and modbus master setup to see whether the data is actually being read/written from the respective sides which both yield the same line of zeros as well.  What I am actually trying to write to is an array of single precision floating data. The registers are structured from ranges F40000-F46534 for 10 elements or have them for range AF40001L1-AF46534L1 of item AF40001L10 where it is an array of length 10. (Referenced ranges here)
    I know 1 thing for sure, the modbus connection works and is ready for data requests, I tested this through NI DSM and manually set data for and my master received them . 
    System and Project specifications
    Windows 7 OS
    Labview Full Development System 2011
    No Labview DSC module but I am using the real time module as referenced by one of the documents
    This project is a real time application with fpga mode (not scan interface mode)
    The master and slave are the same subnet and network
    Modbus Connection Type: TCP
    9074 compact rio 8 slots
    9234 module x3 
    9221 module x1
    9472 module x1
    Shared Variable Engine service running on windows os and rtos system 
    Used this  guide to learn about the modbus protocol as I searched all over the internet to learn about modbus 
    I already having Modbus IO Server software installed on the crio through ni max version 1.8 for NI RIO 4.0
    attached file(s)
    Image of Crio software specifications
    Image of the Data being written into variable in rt block diagram
    Short Version of the problem: Why is the io variable not being written into with properly converted data?

    The data can have zeros but not all of them will be zeros and I have another program (on local computer for database storage)that is recieving the same data through TCP and they are not zeros. 
    If a machine is running and is active then the data that will be collected should not be zero , it should infact  be some analog value > 0.
    I will look into the function you described
    How do you view the errors in the IO server subfolders ?
    Is it the modbus register called error status that returns an error code if so that value is currently 0 
    Regards mzamstl
     

  • Performanc​e of Modbus using DSC Shared Variables

       I'm fairly new at using Modbus with LabVIEW.  Out of the roughly dozen tools and API's that can be used, for one project I'm working on I decided to try using Shared Variables aliased to Modbus registers in the project, which is a DSC tool.  It seemed like a clever way to go.  I've used Shared Variables in the past, though, and am aware of some of the issues surrounding them, especially when the number of them begins to increase.  I'll only have about 120 variables, so I don't think it will be too bad, but I'm beginning to be a bit concerned...
       The way I started doing this was to create a new shared variable for every data point.  What I've noticed since then is that there is a mechanism for addressing multiple registers at once using an array of values.  (Unfortunately, even if I wanted to use the array method, I probably couldn't.  The Modbus points I am interfacing to are for a custom device, and the programmer didn't bother using consecutive registers...)  But in any case, I was wondering what the performance issues might be surrounding this API.
        I'm guessing that:
    1) All the caveates of shared variables apply.  These really are shared variables, it's only that DSC taught the SV Engine how to go read them.  Is that right?
       And I'm wondering:
    2) Is there any performance improvement for reading an array of consecutive variables rather than reading each variable individually?
    3) Are there any performance issues above what shared variables normally have, when using Modbus specifically?  (E.g. how often can you read a few hundred Modbus points from the same device?)
    Thanks,
        DaveT
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.
    Solved!
    Go to Solution.

    Anna,
        Thanks so much for the reply.  That helps a lot.
        I am still wondering about one thing, though.  According to the documentation, the "A" prefix in a Modbus DSC address means that it will return an array of data, whereas something like the F prefix is for a single precision float.  When I create a channel, I pick the F300001 option, and the address that is returned is a range:  F300001 - F365534.  The range would imply that a series of values will be returned, e.g. an array.  I always just delete the range and enter a single address.  Is that the intention?  Does it return the range just so you know the range of allowed addresses?
       OK, I'm actually wondering two things.  Is there a reason why the DSC addresses start with 1, e.g. F300001, instead of 0, like F300000?  For the old Modbus API from LV7, one of the devices we have that uses that API has a register at 0.  How would that be handled in DSC?
    Thanks,
        Dave
    David Thomson Original Code Consulting
    www.originalcode.com
    National Instruments Alliance Program Member
    Certified LabVIEW Architect
    There are 10 kinds of people: those who understand binary, and those who don't.

  • CRIO and ni 9234 modules not working or communicating through fpga with accelerometers, fpga connected to real time application which is also connected to shared variables linked to modbus slave

    Hi,
    I have a compact rio which has a 4 way chassis attached to that chassis is three ni9234 modules they are linked using fpga to a real time application then using shared variables in the low speed loop that are linked to a modbus slave to communicate with dcs, the ni 9234's have accelerometers connected to them with iepe ac coupled option on the c modules, my problem is the real time application seems to be running okay even when power loss occurs it restarts with no problem and the fpga writes to the portable hard drive bin files fine but without a accelerometer connected I get low noise readings as soon as I connect a accelerometer to any one of the 10 outputs it just goes to a fixed number (0.03125) as soon as disconnect it again it reverts back to reading noise, I have run a scan on the modules and only get a spike when I connect or disconnect the accelerometer, I have tested the voltage at the pins of the module and I get 22 volts dc which makes it more likely that the hardware is not the problem but a software is maybe causing this to hang-up, I attach project and files for your perusal. I also carried out a new project which in scan mode directly linked the module input to shared variable and the same scenerio again. Help would be much appretiated. 
    Many thanks
    Jason
    Solved!
    Go to Solution.
    Attachments:
    logger 2plusmodbus2.zip ‏679 KB

    Whren using waveform acquisition with the 9234s we recommend the following FPGA and RT template.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/209114
    it can be extended as a data logger with:
    http://zone.ni.com/devzone/cda/epd/p/id/6388
    or using shared variables combined with scan engine
    http://zone.ni.com/devzone/cda/tut/p/id/9851
    The FPGA in all of these, as well as the RT framework have been used successfully by 1000s of users.  I would recommend giving these a try. 
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

Maybe you are looking for

  • Iphone 4 won't turn on keeps saying plug into itunes when it's on itunes

    Phone randomly shut off and won't turn back on. I keep plugging it into itunes to restore it and it tells me an unknown error occurred

  • Business Systems for File to File Configuration

    Good day. We need to created two (2) Business Systems for our File to File Configuration. Configuration Details: SWCV must be attached to a Product. Technical Systems must be Third Party. Business Systems must be identified as an Application System.

  • Registering a product to download from the app store

    Hello forums, I recently was given a macbook air, A1304. I have a problem on my hands. I have Mac OS X 10.6.8 and would like to upgrade to mavericks. Though, my apple product is not registered under my name. How can I register to download from the ap

  • Disabling of FORWARD and BACK Button of Internet Explorer.......

    Hello everybody, Can anyone tell me how to disable the FORWARD and BACK Button of Internet Explorer through JavaScript.......If possible give me the code snippet.....

  • Reinstall apps on new mac

    Being new to apple, having purchased my iMac the other day, I foolishly did not uptick the box for having the login via the cloud, then compounded it by allowing the system to autofilll the passwords, I could not find them again and after many hours