AzeoTech

Administrators
  • Content Count

    5,655
  • Joined

  • Last visited

Everything posted by AzeoTech

  1. AzeoTech

    Accesing variable value from protcol

    Yes, you should, and then you should create a channel with this setVolt I/O type. Finally have the Set To action of your control change the channel you just created.
  2. Inside DAQFactory, go to File - Preferences and check the box that says "Disable 2nd instance check". That will get rid of that window.
  3. Just add gettime(): GetTime(Max(PO_wind_gust[0h,0h+86400])) Then use formatTime() or formatDateTime() to format that number into something you, as a non-computer, can read.
  4. AzeoTech

    Accesing variable value from protcol

    Did you create an actual protocol driver, or just write a sequence? It is often easier to just create a sequence unless you plan on reusing the code across many applications. If you did a protocol driver, probably the easiest thing to do is put that code into an output I/O type, then create a channel with that I/O type. Then you can use the SetToValue variable in your script to set the appropriate value. In the screen component you would set the Set To Channel to a channel you created with that I/O type. See section 15.2.2 in the user's guide. Feel free to post or email what you have so I can give a more detailed answer.
  5. AzeoTech

    Scheduling, Simultaneous sequences.

    You can assign them low priority. High priority is for things that need to happen exactly when you want them to happen. I'm guessing your schedule can be 1/2 a second late, so priority 1 is probably fine.
  6. AzeoTech

    Scheduling, Simultaneous sequences.

    All sequences started with beginseq() or by selecting Begin Sequence run simultaneously with other sequences and the rest of DAQFactory. The exception would be sequences called as a function: mySequence()
  7. 1. Well, the channel that has the wrong data isn't the one that is empty. It is some other channel before it. Are you sure ALL your channels have data? They all have to have the same amount of data too. 2. I would expect it to error out of the loop, but it kind of seems like it is just skipping the line that adds that value and not even putting a comma in. Do you see fewer columns than expected?
  8. Empty channels are going to throw your logic. I'm not sure that you'll get a "," even if the channel is empty. I'd use isempty() to check.
  9. Glad you got to the bottom of it, and thank you for sharing the result!
  10. Are you sure some of those channels aren't empty? Is it off for the entire column or just a few rows?
  11. The function you wrote would only work if all the channels had the exact same number of historical data points, and would only work if no data came in during the time the for() loop runs. If I wanted to successfully align data and log it, but only after the fact, I would generate each line in-situ, then write it at the end. I'd do that by creating a Test String channel (with Timing 0 of course), then a sequence that is always running like this: Private string channelNames = Channel.ListAll() private string strLine while(1) delay(1) try strLine = FormatDateTime("%c", systime()) for(j = 0, j < numrows(ChannelNames), j++) strLine += "," + DoubleToStr(Evaluate(channelNames[j] + "[0]")) endfor myTestStringChannel.addValue(strLine) catch() endcatch endwhile Then when I wanted to write this to disk, I'd write the header like you did, then write the enter strLine history, or whatever part of it I wanted.
  12. You don't want DAQFactory to be the slave. Possibly, but the radio isn't responding to DAQFactory queries except occasionally, and then the response doesn't look to me like a Modbus, that's why I think its either a comm setting issue, or the device isn't setup to be a Modbus slave, but instead a different protocol.
  13. Yes, that is because Windows made the program files folder read only unless run as admin. And right, inside the protocol script for an iotype, there is a local variable created called "Channel" that is passed in corresponding to the channel # in your channel. So, it gets confused and uses that variable instead of the global Channel object.
  14. DAQFactory is the master because it is making the queries. The device is the slave because it only responds to queries. It won't say anything unless asked. That device supports several different protocols, and typically you have to configure the device for the protocol you want as you can't talk multiple protocols on the same port.
  15. The device doesn't seem to be replying with Modbus. Are you: a) sure that the device is setup for Modbus RTU slave and not another protocol, b) sure you have all the comm settings right? Often Modbus uses Even parity.
  16. 1) you have a comment in line 39 that isn't marked as a comment. Its outside functions in the class, but still will have unpredictable behavior. 2) for some reason you commented out l2 at line 42. Then you go on to use l2 in line 45 and 46. This may be where you are getting the C1000 error since l2 never exists.
  17. Certainly. But given your error message, you probably have a typo somewhere. Any chance you can post you script? Feel free to X out the URL or anything else you don't want to share.
  18. Sure, use ListAll(), then use evaluate(): private string chans = channel.listAll() for (private x = 0, x < numrows(chans), x++) for(i=evaluate(chans[x] + ".GetHistoryCount()-1"), i > 0 , i--) Private.strLine = FormatDateTime("%c", evaluate(chans[x] + ".Time")) + "," Private.strLine += DoubleToStr(evaluate(chans[x] + "")) + "," File.Write(Private.handle, strLine); delay(.1) endfor endfor Notes: 1) you can do ListAll() and just specify a group of channels by providing the group name as a string 2) the above code will be VERY slow, especially with the delay(0.1) in there 3) I recommend using numrows() instead of GetHistoryCount()
  19. What is datain? And what about the other ? statements output?
  20. We had to change security settings. You'll need to go into Windows Explorer and make it so the Persist folder is writable by all users, or select another folder that has these permissions.
  21. I'm not sure I helped. I would try manually adjusting all your registers to 0 notation. I almost always do this. So if the manual says 40,001, strip the 4 and subtract 1 and put 0 in the Channel # in DAQFactory. So, 41,234 would become 1233.
  22. 25535 or 65535? (65535 is 2 to the 16th - 1 and a number you see often in computers, 25535 is not seen often and looks like a typo of 65535). It is important to understand that Modbus register addressing style can vary from manufacturer to manufacturer. Some manufacturers use 40,000 notation, so that 40,001 is the first holding register. This translates to register 0 in the actual Modbus communication packet (strip the 4 and subtract 1). It also limits one to 9,999 holding registers. Other manufacturers use 0 notation, so that 0 is the first holding register and matches with the Modbus communication packet. In this case, there are 65535 possible holding registers locations. The problem is that a number of manufacturers just flat out misunderstand all this, and will say that there register is, say, 42,323, which one would read as either 2322 or 42,323 depending on which of the two notations they were using, but the manufacturer will actually subtract one without stripping the 4, so they expect 42,322 in the packet. This is just wrong, and confusing. In your case, it is hard to tell. DAQFactory attempts to automatically figure out which notation you are using. If you only provide holding and input registers in the 30,000 (input) and 40,000 (holding) range, then it assumes you are using the strip 4, subtract 1 notation, and it will do that, making 40,001 into 0. If, however, you read a register below 30,000 (or above 50,000) it will assume that all your registers are in 0 notation and send them as is. It sounds a bit like DAQFactory it is doing this, treating 40,001 as 40,001 and not as 0. You'd have to look at the actual packet to be sure, or just check and see if you are reading registers below 30,000.
  23. AzeoTech

    Channel Error Timeout and port locked

    The C type errors codes are listed at the end of the help, but that list isn't all inclusive. Device and protocol codes are typically in the section with the protocol if at all.
  24. AzeoTech

    Channel Error Timeout and port locked

    No, those are just DAQFactory error codes. It makes it easier to do error handling if you choose to have script do something based on errors.