• Content Count

  • Joined

  • Last visited

Everything posted by AzeoTech

  1. That's a Modbus specific error returned by your device. You'd have to check your device docs as the meaning of that really depends on the device.
  2. First get it so you can manually control the Tick DACs. I'm pretty sure there is sample code on the LabJack website. After you have that working, then you can put the desired code in the Event for the appropriate channel. Event's are code in channels that get executed every time the channel gets a new value. You get to them by expanding CHANNlELS: in the workspace, clicking on a specific channel, then selecting the Events tab.
  3. AzeoTech

    Calculate rms value of an an array

    There is no built in function for calculating RMS, but if you can point me to a page with the formula you'd like to use, I can probably show you how to write it in DAQFactory.
  4. What do you mean by counting? Do you want to read 125 times then stop? I'm unsure what you want to do.
  5. AzeoTech

    CRC &LT

    OK, somewhere along the line, the system or your browser encoded the code for browser compatibility. &gt; means a greater than sign. &lt; is less than, &amp; is the amperstand. Once you replace those it should make sense. Note however that this is the CRC for Modbus. Not all systems use the same CRC and you should probably look at your device's documentation to see how they do it. private crc = 0xffff private raw = asca(buffer) for (private x = 0, x < GetLength(buffer), x++) crc = crc # raw[x] for (private j = 0, j < 8, j++) if (crc & 0x0001) crc = crc >> 1 crc = crc # 0xA001 else crc = crc >> 1 endif endfor endfor return(crc)
  6. It would not be difficult to create one as I believe every variable, even the event (strEvent) code is available from script. Use channel.listAll("groupName") to retrieve a list of channels, then loop through that list and using execute() copy all the parameters from one to the other, remembering to change the group name, as well as the channel name for the new channels.
  7. My guess is that they are specifying the function codes in hex, as 10 hex is 16 decimal. Especially since there is no function 10 in standard Modbus. So you should be able to use code 16. If it isn't working it may be an alignment issue. What error are you getting?
  8. I don't know what you have. Can you post your script?
  9. AzeoTech

    Pop up message

    It means the document is open by another program exclusively and DAQFactory can't access it. It is not a message I've ever seen with a DAQFactory document, especially since DAQFactory doesn't access the .ctl document except when it is loading and saving. Are you perhaps triggering a save from script?
  10. Sure, just do: read(myChannel)
  11. It depends on what communication card you have. It looks like all of the serial CJ communication units support Modbus which would be easy to use with DAQFactory. The other boards are ethernet based and use Devicenet, Ethernet/IP or Profibus which would require an OPC server or protocol converter.
  12. You have to put quotes around any string literals in your SQL statement. So at the end it is: ',"' + Placa[0]+'")') It's hard to see here, but I replaced the double quotes with single quotes and put double quotes inside. DAQFactory treats them the same as long as they are paired up, but I don't know if SQL SERVER supports single quotes. I usually find it helpful to copy my db.execute() line to another line before it, and remove it down to just a ? (print) statement: ? "INSERT INTO Alival_Descargue.dbo.Estados_PLC(Fecha,VolumenRemisionado,Temperatura,Placa) VALUES (CONVERT(datetime,GETDATE(),20),"+Volumen_remisionado[0]+","+TemperaturaLlegada[0]+","+Placa[0]+")" Then you will see the actual SQL statement that you generated in the command alert window. You can even copy / paste it into a SQL command line and let SQL Server tell you exactly where the error is. But I know it will be the lack of quotes, as your's will evaluate to something like: INSERT INTO Alival_Descargue.dbo.Estados_PLC(Fecha,VolumenRemisionado,Temperatura,Placa) VALUES (CONVERT(datetime,GETDATE(),20),1,2,MyString) where you really want: INSERT INTO Alival_Descargue.dbo.Estados_PLC(Fecha,VolumenRemisionado,Temperatura,Placa) VALUES (CONVERT(datetime,GETDATE(),20),1,2,"MyString")
  13. No, you are not missing anything. V channels are largely left over from before DAQFactory had real scripting with variables. However, it seems many user's still use them, so we haven't removed them. If you have some suggestions on ways to improve them, please post them on the Suggestions forum and there is a good chance they will get implemented.
  14. AzeoTech

    Software Update Policy Question

    The current version is 17.1. You can download it here: Just download and install over your existing install. Revision history is here:
  15. For a single flag it is especially easy: private handle ="c:\data\myfile.txt", 0, 1, 0, 1) file.write(handle,"5") file.close(handle) or to read from the file: private handle ="c:\data\myfile.txt", 1,0, 0, 1) private string datain = file.close(handle)
  16. AzeoTech

    Graph appearance

    Jeff, I believe that is just a matter of what order you add the traces. I can't remember which way it goes, but try adding the traces line first then area, and if that doesn't work, do it the opposite on a new graph.
  17. Under newer versions of WIndows, the registry gets tricky to use due to tighter security. This is probably why DAQFactory is unable to write to the registry. I believe we have tried to have our installer expand the security rights of the registry folder for DAQFactory variables, but I'm not sure if that is in the 17.x releases. You probably should consider using a file instead. This original post was from 4 years ago when Win 7 was the prevalent OS.
  18. AzeoTech

    Connects to wrong Ethernet card is not a valid IP address. It is the address devices give themselves when they are setup for DHCP but no DHCP server can be found. It also is not on the same subnet as either of those cards. My guess is that you unplugged the PLC from your LAN where there is a DHCP server and put it on its own network with the DAQFactory where there is not. The PLC can't find a DHCP server and so doesn't get a usable IP address, and the of course DAQFactory can't talk to it. So, it really has nothing to do with DAQFactory, but rather your LAN setup. In general, I do not think you should ever have PLC's or any DAQ device running on DHCP in production. It is great during startup because you can get to the device initially for configuration without changing your PC's IP, address, but you should always change your device to have a static IP address. Despite what some may say, DHCP does not always give the same IP address to the same device. So, if you had two identical PLC's wired into different stuff, both on DHCP, it is possible for the devices to actually swap IP addresses and then you are communicating with the wrong device, and could, so to speak, "fire the rocket" when you really just meant to turn on the lights. Note that the IP address of the PLC will have to be on the subnet of the desired card, so either 192.168.2.X or 192.168.0.X depending on which card you are connecting to. Also, just a general note: if your device is supposed do be somewhere on your LAN, and you are not connecting to it directly through the Internet (which I don't generally recommend), the IP address will pretty much always have to start with 192.168.x.x, or 10.x.x.x or 172.16.x.x through 172.31.x.x, and you rarely see the 172 range. These are the only IP addresses used in LANs because they are non-routable and thus not directly accessible through the Internet. If you get something else, like 169.254 and you aren't connecting to a device on the Internet, you know you did something wrong.
  19. AzeoTech

    Connects to wrong Ethernet card

    They actually aren't on the same subnet. They just have the same subnet mask. What IP are you trying to reach? Which connection gets you to your LAN and the Internet?
  20. AzeoTech

    Connects to wrong Ethernet card

    Are the two network cards on the same subnet? If you don't know what I mean, just post what the IP address is for the PC on each card. You can find this by going to a command prompt and typing: ipconfig
  21. AzeoTech

    I/O Type

    Yeah, I can't guarantee that stripping the high order bits off is going to solve the problem. It is just an educated guess on something to try.
  22. AzeoTech


    No, because the knob captures the event already and doesn't pass it through. You can't really use mouse events on components that already natively require the mouse, such as a knob, or switch.
  23. You are making a somewhat common error. timerz as you have it without quotes is a symbol meaning it references a variable, channel or something else with that name. In your case, it is probably NULL, which causes CreateProperty to fail. You need to provide a string with the name of the new parameter, i.e.: createProperty("timerz", 100) This may be a common error because there are a few functions that take symbols when really they should take strings, namely the begin/end functions, i.e. beginseq(), endseq(), etc. This is left over from very old DAQFactory.
  24. AzeoTech

    I/O Type

    No, you said the range was 0 - 2047. 2047 is 0x7FF in hex. Doing Value & 0x7ff strips off any bits above 2047. Sometimes, devices that aren't a full 16 bit, will use the upper bits for status or other things, which may be why you are getting numbers in the 3500 range.