Build array from random values via ethernet

Am trying to save data that comes from ehternet ((random values (modbus protocol)) in an array.
I am using an index array.....but all the values are the same!! How can I sort them??
It functions correctly with a for loop with random numbers build.......but it doesn't work with the data from ethernet.
Can someone please help me??
Attachments:
Data.vi ‏16 KB

chendel wrote:
Am trying to save data that comes from ehternet ((random values (modbus protocol)) in an array.
I am using an index array.....but all the values are the same!!
You just read the same shared variable 100 times within a few nanoseconds. Apparently, the variable gets modified less often on the other end.
chendel wrote:
How can I sort them??
If all array values are the same, they are already sorted.
You need to rethink your code. maybe you can make the shared variable an array and write the entire random array on the other end, the read it out once.
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • I recently purchased a MacBook Pro and transferred data from my MacBook via Ethernet cable. I did not consolidate my accounts and kept using my MacBook. Can I update the data transfer now using Ethernet and can I consolidate my accounts?

    I recently purchased a MacBook Pro and transferred data from my MacBook using Migration Assistant via Ethernet cable.  I was confused about consolidating my accounts, so I continued to use my old MacBook.  Can I now update the data transfer using the same process and begin using my new MacBook Pro exclusively?  How do I consolidate my existing accounts?
    Thank you.

    Of course. It does everything it did before Yosemite. You just won't be able to send or receive SMS messages with it.

  • Build Array and Output Values to Text or Excel File

    I know this is a simple question but I need some help. I'm reading a DC voltage in LabVIEW a while loop. I want to store all the read values into an array and export that array as an text or Excel file. I had a VI that I build before for this but I cannot seem to find it and I can't remember how I did it before. Any help is appreciated. I think I can do the exporting part but I do help with building the array (storing all the data values).

    I run into a problem while using the "Write to Text File Function". Initially I took about 60 measurements and wrote to a text file. That works but I increased the amount of measurements to be taken to 600 and when I did that the output in the text file are all Chinese letters (or that's what it seems like). Is this because I'm writing too much data?
    When I use the "Write To Spreadsheet File VI" to write the measurments it works fine for the 600 measurements. The problem with this is I cannot insert any text. Using the "Write to Text File Function" I inserted some text before the measurements and "end of lines", to format the data. Attached is a screenshot of my VI.
    Attachments:
    measurements.PNG ‏45 KB

  • How to access PXI 5152 from a Laptop via ethernet cable?

    Hi,  I have the following setup.
       PXI 1002 chasis
             PXI 8175 controller
             PXI 6025E DAQ card
             PXI 5152 scope
              PXI 6602 counter timer.
        I have written a program that uses the counter timer for triggering an external circuit board and the scope for data acquisition. I need to run the vi on my laptop and get access to the PXI devices.
    I have connected the Laptop to the PXI using a cross over LAN cable and configured manual IP addresses and identical subnet masks on both systems. If i run the Remote Device Access Server(RDA) on the PXI chasis, I can access the 6025E card and a portion of the 6602 card also. I can see them from MAX directly.But how can I access the scope, as the RDA server works only with DAQ devices.
    What I want is a method to configure the PXI system as a remote device on my Laptop.so that I can see the PXI cards in NI MAX on my laptop.
    I would like to see if I can do this without having to get a new express card.
    Please help!! I am newbie with remote systems.
    Thanks in advance!!

    Hi JJ,
    Sorry for the delay. You are correct that using remote
    front panels will still require the VI to run on your PXI system, and you will
    not be able to do any configuration other than that allowed with the front
    panel. If your controller is slow, is there a reason why the development can’t
    be done on another computer and then transferred to the PXI system only to
    test? To help speed things up on your PXI system, you could create an exe on
    your development machine (if you have the application builder or LabVIEW Professional)
    and then run this on the PXI system. This only requires the LabVIEW runtime engine
    (which is already installed since LabVIEW is on the system), but will not
    require LabVIEW to open. If you do this, please read this knowledgebase: How Do I Enable The Web Server Or Use Remote Panels With an
    Application (EXE) Built in LabVIEW?
    As far as the RT vs. Win 2000 – this can
    change things very juristically. If you boot using RT, then this will require
    you to develop on your host computer, and then deploy it to the RT system. If
    you use Win 2000, then my above comments apply.
    Hope this helps you out.
    Message Edited by David L. on 06-10-2008 02:37 PM
    David L.
    Systems Engineering
    National Instruments

  • Time Capsule Base via ethernet to an Airport Extreme to extend Wireless

    I have set up a new Time Capsule dual band (TCBStn) as a base station (connected to the internet). I want to connect a new Airport Extreme dual band in a family room far away from the base via Ethernet. This family room has an Apple TV to which I want to stream video. I am not able to connect the AE via the Airport Utility as the Airport Utility does nor recognize the AE.

    My recommendation is to configure your two base station as a "roaming" network. This will allow wired/wireless clients to connect to either and still be able to "see" each other for sharing.
    Please start by powering-down all of your network components as follows:
    o Power-down the modem, Time Capsule (TC), AirPort Extreme Base Station (AEBS), Apple TV (ATV), and the iMac. Note: The power-down order is not critical.
    o With all of these components powered down, disconnect both the TC & AEBSn from the network, and then, perform a "factory default" reset on both to get them back to their "out-of-the-box" configuration.
    o After both have been reset, remove them from power, and then, reconnect them as follows: modem > \[WAN port] > TC > \[LAN port] > \[WAN port] AEBSn, where ">" represents an Ethernet connection.
    o Power-on the modem; wait at least 10-15 minutes.
    o Power-on the TC; wait at least 5-10 minutes.
    o Power-on the AEBSn; wait at least 5-10 minutes.
    o Power-on the iMac.
    o For now, leave the ATV powered-off.
    In this configuration, both routers will be transmitting their own wireless network, each having a Network Name of something like: Apple Network NNNNNN, where the Ns represent the last six digits of their respective AirPort IDs.
    Now, from the iMac, use the AirPort Utility (in Manual Setup) to access the TC to make the following configuration changes:
    o Time Capsule > Base Station > Time Capsule Name = TC
    o Time Capsule > Wireless > Wireless Mode = Create a wireless network
    o Time Capsule > Wireless > Wireless Network Name = <enter the desired Network Name>
    o Time Capsule > Wireless > Radio Channel Selection = Automatic
    o Internet > Internet Connection > Connect Sharing = Share a public IP address
    o Leave all the other default settings (for now).
    o Click on Update to write the new configuration to the TC.
    While still in the AirPort Utility, select the AEBSn, and then, make the following changes:
    o AirPort > Base Station > AirPort Extreme Name = AEBSn
    o AirPort > Wireless > Wireless Mode = Create a wireless network
    o AirPort > Wireless > Wireless Network Name = <use the same Network Name that you created for the TC>
    o AirPort > Wireless > Radio Channel Selection = Automatic
    o Internet > Internet Connection > Connect Sharing = Off (Bridge Mode)
    o Leave all the other default settings (for now).
    o Click on Update to write the new configuration to the AEBSn.
    You should now have a basic roaming network. Verify that your iMac can access the Internet while connected to either base station by wire or wireless. Please post back your results.

  • Selecting random values from an array based on a condition

    Hi All,
    I have a small glitch here. hope you guys can help me out.
    I have an evenly spaced integer array as X[ ] = {1,2,3, ....150}. and I need to create a new array which selects 5 random values from X [ ] , but with a condition that these random values should have a difference of atleast 25 between them.
    for example res [ ] = {2,60,37,110,130}
    res [ ] = {10,40,109,132,75}
    I have been thinking of looping thru the X [ ], and selecting randomly but things look tricky once I sit down to write an algorithm to do it.
    Can anyone think of an approach to do this, any help will be greatly appreciated ...

    For your interest, here is my attempt.
    import java.util.Random;
    public class TestDemo {
        public static void main(String[] args) throws Exception {
            for (int n = 0; n < 10; n++) {
                System.out.println(toString(getValues(5, 25, 150)));
        private final static Random RAND = new Random();
        public static int[] getValues(int num, int spread, int max) {
            if (num * spread >= max) {
                throw new IllegalArgumentException("Cannot produce " + num + " spread " + spread + " less than or equals to " + max);
            int[] nums = new int[num];
            int max2 = max - (num - 1) * spread - 1;
            // generate random offsets totally less than max2
            for (int j = 0; j < num; j++) {
                int next = RAND.nextInt(max2);
                // favour smaller numbers.
                if (max2 > spread/2)
                    next = RAND.nextInt(next+1);
                nums[j] = next;
                max2 -= next;
            // shuffle the offsets.
            for (int j = num; j > 1; j--) {
                swap(nums, j - 1, RAND.nextInt(j));
            // add the spread of 25 each.
            for (int j = 1; j < num; j++) {
                nums[j] += nums[j-1] + spread;
            return nums;
        private static void swap(int[] arr, int i, int j) {
            int tmp = arr;
    arr[i] = arr[j];
    arr[j] = tmp;
    public static String toString(int[] nums) {
    StringBuffer sb = new StringBuffer(nums.length * 4);
    sb.append("[ ");
    for (int j = 0; j < nums.length; j++) {
    if (j > 0) {
    sb.append(", ");
    sb.append(nums[j]);
    sb.append(" ]");
    return sb.toString();

  • Efficientl​y building an array of increasing values for a graph

    I need to build an array of values increasing by 3E-8.  Initializing an array and changing each value in a while loop works fine, but it is terribly slow.  Is there a better (faster) way of building an array of increasing values like this?

    Thanks for the suggestion, it looks like that could do what I'm looking for.  A kind tech solved the problem for me by phone -- I knew it was reading and writing the entire 100,000 element matrix to memory at each step, but I couldn't figure out how to get it to stop.  A shift register brought the run time from over 2 minutes to under 1 second.
    Thanks again for responding!
    Message Edited by Deamiter on 11-07-2006 06:46 PM

  • Building DLLs from VIs with array as output

    Is there any special way to build DLLs from VIs having arrays as outputs. Suppose I have a VI "Random" with input "nrand" and output an array "the_random2". When I build DLL from the VI, I have something like this in my header file
    void __stdcall Random(long nrand, double the_random2[]);
    Now it returns void. So I have to pass the array as pointer and retrieve it. If I use Mathscript to load the DLL and call this function, how do I pass the pointer to the array "the_random2"? Simply speaking, any useful method to build DLLs with array outputs and the right way to call them from Mathscript would be appreciated.
    Regards
    NRK

    Hi,
    Building DLLs in LabVIEW is described in this tutorial.  
    Mathscript can call shared libraries such as DLLs, however make sure
    that they are compliant with the supported data types as stated here in
    this help page.  All supported functions for calling/loading shared libraries is described here. 
    Note that these functions are not supported with the base package.  The
    details of the sytax of each function is described in their specific
    help page.
    Hope this helps!
    Regards,
    Nadim
    Applications Engineering
    National Instruments

  • How can i get the random values from database?

    Hi,
    i want to get random values from database.
    I try my best find no solution
    plz give solution in either sql query or java method.
    thanks in advance.

    try this:
    Give a numeric row-id to each row of database.
    say (1-100) for 100 rows
    In the program use random function to get random number between 0 and 1. this value u multiply with 100(or total number of rows) and take integer value of it . u then perform sql query to select the a row which matches randomly genarated value with row-id assigned to each row of database
    madhu

  • Can't connect via ethernet after iBook wakes up from sleep

    I'm running 10.4.0 on a 1.33 GHz G4 iBook. Since buying the computer in 2005, I've been connecting to the internet in various locations via AirPort, though I have hooked my iBook up to ethernet connections in the past and had no problems.
    Recently I moved to a university where I must connect via ethernet, as the wireless network doesn't extend to the areas where I do most of my work. I bought a new cable. Much of the time, my connection is fine. But frequently I am unable to connect to the internet at all via ethernet, and I've noticed that it's always after I've woken the computer up from sleep. I've tried various ridiculous "kick the car and maybe it will start" techniques like unplugging the cable at both ends and waiting, restarting five or six times in a row, etc., and it starts connecting eventually, but I have NO idea why or why not. When I check my network preferences, I get the message "Built-in Ethernet is currently active and has the IP address [xxx.xxx.x.xxx]. You are connected to the Internet via Built-In Ethernet." But I'm not. What's going on here?

    Sorry, meant to indicate an IP address without giving the exact numbers, and it came up as an HTTP address. My network connections system preference panel indicates a normal IP address. (And it's not self-assigned.)

  • Transfering files from PC to Mac via ethernet cable

    I have been unable to connect my Mac for file transfer. I followed the directions on the following sites:
    http://docs.info.apple.com/article.html?artnum=304721
    http://docs.info.apple.com/article.html?artnum=106471
    I connected both computer via an ethernet cable and used the 'Connect to Server' option in the finder. It searches for a while and then gives me the following error:
    The Finder cannot complete the operation because some of the data in "smb://5.173.180.164/SharedDocs" could not be read or written. (Error code -36).
    The folder i specified is open for sharing and i've run the network wizard on the PC. I can't seem to figure out what's wrong.
    I appreciate any help you can give.
    Message was edited by: jaboc77

    You can connect them via ethernet cable. It will work fine.
    No special software needed on either side.
    What is it you are trying to do? Share files? Printers? Internet?
    This article from iFelix may offer some help to you:
    http://www.ifelix.co.uk/tech/3020.html

  • Have new Airport Extreme via ethernet cable from HughesNet Gen4 modem. Using NetGear WN3500RP extender. NetGear asks for different names for the 2.4 and 5 GHz bands. Most of what I have read indicats extender shoul have same name as main network?

    Have new Airport Extreme conneted via ethernet cable from HughesNet Gen4 modem. Using NetGear WN3500RP extender. NetGear asks for different names for the 2.4 and 5 GHz bands. Most of what I have read indicates extender should have same name as main network? How is it best to configure with the Airport Extreme router 802.11ac?

    Different names for the 2.4 and 5 GHz networks are optional, but can be convenient for you to distinguish one from another. It's up to you.

  • Audio via ethernet from MacBook

    I’m a newbie--just switching to Mac from Windows.
    I can’t claim to be a true audiophile, but I have tendencies in that direction. I’m in the process of storing a thousand CDs in Apple LossLess, and have a pretty good stereo.
    My new MacBook will be in the back of my house in my office, connected to a hardwired LAN. The LAN has an ethernet connection right where my stereo is. I have an NAD integrated amp with no optical/digital input. I want to stream audio from the MacBook to the stereo. I’d like to leave the MacBook where it is, and have something like an iPhone or iPad as a controller where my stereo is.
    Can I just plug in an Airport Express to the Ethernet where my stereo is? Will it stream audio from my MacBook to the stereo over the Ethernet? Or will it stream it wirelessly? Do I care? (Shouldn’t an Ethernet connection be a lot higher quality than wireless?)
    Is there a better way to get audio from the MacBook to the stereo via Ethernet—even if it requires a non-Mac solution?
    --Werner

    Hello WLohe. Welcome to the Apple Discussions!
    If your goal is to use iTunes on your MacBook as the audio source of ALAC files, then they could be streamed over Ethernet. iTunes uses AirTunes for audio streaming. AirTunes can be transmitted over wire or wireless. At the NAD end, you would need either an AirPort Express Base Station (AX) or Apple TV, to receive the AirTunes streams. In turn, these devices would offer digital optical or analog outputs to the NAD.
    If however, your goal is to stream these files outside of iTunes, then you would need a different solution. One such solution is to run a DLNA media server on the MacBook, and then, stream media to a DLNA client ... like an Xbox 360. In this case an AirPort Express would not be necessary.

  • Ip adress not recognized in windows explorer when trying to transfer data from my PC to my TC via ethernet.

    Hello,
    I currently have a Time capsule and a Pc with a Windows 7 operating system. Im trying to transfer data from my PC to my Time Capsule via ethernet cable because wirelessly takes too much time given that I have a lot of data to transfer. In my Airport Utility I already set my workgroup to "WORKGROUP" and the file sharing to "write and read", I also disconnected the Wifi on my Pc so the ethernet would work without confusions.  But when I type my Time Capsule's Ip address in my windows Explorer it opens a page that says something like "this website is not available". Maybe I did something wrong while setting up the time capsule for file sharing. What are the correct steps for me to be able to transfer data from my PC to my time capsule via ethernet cable?

    I do not normally use a PC, but we have a guest here this week with a PC using Windows 7 which allows for some "testing" on the network.
    What is the Ethernet connected IP address of the Time Capsule?  Mine is 10.0.1.2
    If we open Windows Explorer and type in
    \\10.0.1.2
    the Time Capsule drive is immediately seen on the PC once I enter the device password for the TC to connect.
    I can also type in the name of the Time Capsule and things work the same way. My Time Capsule name is TC
    \\TC
    brings up the same log in as the IP address method above
    We have not tried mapping the drive, but might. Will post on results if we do that.

  • Can't access desktop Mac from Laptop Mac via Airport/Ethernet

    Hi.
    I have an iMac G5 running 10.3.9 and a MacBook Pro running 10.4.8. I have recently gotten DSL. I have a DSL MODEM connected to a Belkin Router. The router is not wireless. I bought it when I got the iMac a couple of years ago, and the iMac had no Airport card in it.
    I have connected the router to the MODEM, and the iMac (which does not have an Airport card) to the router via Ethernet. I have an Airport Express Base Station connected to the Belkin Router via Ethernet.
    My MacBook Pro connects to the router via Airport.
    I am connected to the internet with no problem.
    My first problem is that, on the laptop in Finder, I can connect to my iMac through Connect to Server with no problems. However, I cannot do the same (i.e., connect through Connect to Server) from the iMac to the laptop.
    The second problem is that I cannot use the printer connected (USB) to the iMac from the laptop. I could when the laptop was connected via Ethernet alone, but not since I introduced the Airport intot the network.
    What am I doing wrong? BTW, I don't have an extra Ethernet cable or the right USB cable to connect the printer to the DSL MODEM, so I haven't tried that yet.
    Thanks for any help you can give me.

    Make sure that the AirPort Express Base Station (AX) has "Distribute IP addresses," found on the Network tab of the AirPort Admin Utility, disabled.

Maybe you are looking for