Beckhoff TwinCat starting out. Help

Beckhoff sent me an example and I implemented it. Totally new to this and codesys, did not really know what Ineeded to do to use the FB_S_UPS_CX80XX function block.
This FB activate the internal UPS for writing persistent data. In fact, after power failure the UPS give time to cpu for writing persistent data in internal memory.

Next question.
What is the diffenerence with the three different network ports (X001, X101, X102)?

I have been connedted to the X001 via DHCP. In System Manager, I just assigned it a static IP address. Any reason that I should or should not use X001? I will be talking to this controller via AmsAds from my host control system. Should that link be X101/X102 for some reason?
First of all, I recommend you always use fixed IP and never use DHCP. With fixed IP your communication will establish easier and quicker.
X001 is not a real time Ethernet and used for downloading and uploading program to/from the PLC.
X101 and X102 are switched and they are real time Ethernet which is used for communicating with remote I/O and HMIs. Of course you can use it as a programming port like X001. By the way, you can not change the IP address of X101 and X102 with System Manager. You should use this address in your web browser "CPU IP or Name/Config" to change the IP address.
 
This FB activate the internal UPS for writing persistent data. In fact, after power failure the UPS give time to cpu for writing persistent data in internal memory.


First of all, I recommend you always use fixed IP and never use DHCP. With fixed IP your communication will establish easier and quicker.
X001 is not a real time Ethernet and used for downloading and uploading program to/from the PLC.
X101 and X102 are switched and they are real time Ethernet which is used for communicating with remote I/O and HMIs. Of course you can use it as a programming port like X001. By the way, you can not change the IP address of X101 and X102 with System Manager. You should use this address in your web browser "CPU IP or Name/Config" to change the IP address.

The FB is figured out and working well.

Yes I will need fixed IP addresses. I will be communicating to the CX from my host system (A data acquisition and control software running on Linux PC) utilizing the ADS capability. With that, I'm confused on what network would be the best? This link shows X001 ADS. Would it be best to connect my DAQ system to X001 or X101?

http://infosys.beckhoff.com/english.../cx8090/html/CX8090_TechnDataEthernet.htm&id=

I will not be communicating from this CX to any other CX, BC, etc. I have EK1101s and EK1110s in use for extending the EtherCat bus.

https://infosys.beckhoff.com/englis...ent/1033/cx8090/html/cx8090_title.htm&id=1472
This link somewhat describes the setting of the IP addresses for X101/X102. There is a dip switch setting that states "The complete IP address is taken from the operating system." I would assume then that would mean I can use software to set an IP address that is different from "192.168.1.XXX". How do I go about that? I have not yet found any information on this.

Thanks
 
Not to but in here ...
the CX is a windows embedded machine, right?
using a mouse and keyboard connected via USB, hit the windows key then go to control panel / network settings / find the network adapter in question and change the IP address.
 
Not to but in here ...
the CX is a windows embedded machine, right?
using a mouse and keyboard connected via USB, hit the windows key then go to control panel / network settings / find the network adapter in question and change the IP address.

The CX8000 series does not have USB or DVI interfaces.

If you do not have CERHost yet, I recommend you download it:

http://infosys.beckhoff.com/english...sw_os/html/cx1000_os_ce_remotedisplay.htm&id=

It will let you remote desktop to your controller and set the IP addresses just like you do on your PC.

You can also set the IP address of one of the port by using System Manager.

Ok will try this.


I keep forgetting/not understanding that this is a windows system.

Thanks all for continuing to answer my questions.
 
I will be communicating to the CX from my host system (A data acquisition and control software running on Linux PC) utilizing the ADS capability. With that, I'm confused on what network would be the best? This link shows X001 ADS. Would it be best to connect my DAQ system to X001 or X101?

For this purpose you should use X101

There is a dip switch setting that states "The complete IP address is taken from the operating system." I would assume then that would mean I can use software to set an IP address that is different from "192.168.1.XXX". How do I go about that? I have not yet found any information on this.

Thanks

Yes, your assumption is true. You can change the range"192.168.1" by the browser which I told you or use the Archie recommendation. CERHost also works fine and it is really easy to use. But don't forget to change the dip switches in write place. I mean if you want to give the IP address totally from OS you should off DS10 , DS9 and on DS1 to DS8
 
I have everything up and running. Thanks for all of the help. I had a problem with the 8090 on startup. It seems I have too much IO connected to this thing. When running, the 8090 is fine as far as cpu load. On startup though, the CPU evidently gets bogged down trying to setup all of the IO. Beckhoff tech support spent about 1.5 days on this. They increased the idle task to 10ms and this has helped a great deal. Removing all of the startup data for the terminals also helps.


Now for another question. Does anyone know how to get time as unix time? I would like to have Unix time on the PLC, read that into my system and compare the two. If the values differed by more than a very small amount, I would know something is wrong.
 
I'm not familiar with unix time but if you want to get time from PLC or writing time to PLC, there is several function blocks in Utility library. For example: for getting plc time you can use
"NT_GetTime"
 
I'm not familiar with unix time but if you want to get time from PLC or writing time to PLC, there is several function blocks in Utility library. For example: for getting plc time you can use
"NT_GetTime"

Unix time is seconds since Jan 1, 1970.
Currently 1454165638
http://www.unixtimestamp.com/

The NT_GetTime seems to return date/time to TIMESTRUCT
TYPE TIMESTRUCT:
STRUCT
wYear : WORD;
wMonth : WORD;
wDayOfWeek : WORD;
wDay : WORD;
wHour : WORD;
wMinute : WORD;
wSecond : WORD;
wMilliseconds : WORD;
END_STRUCT
END_TYPE
 
TwinCAT has functions available to convert the TIMESTRUCT time to the Unix time.
First use SYSTEMTIME_TO_DT to combine the eight elements of TIMESTRUCT and then use DT_TO_DINT to convert that to seconds from Jan 1, 1970
 
TwinCAT has functions available to convert the TIMESTRUCT time to the Unix time.
First use SYSTEMTIME_TO_DT to combine the eight elements of TIMESTRUCT and then use DT_TO_DINT to convert that to seconds from Jan 1, 1970


Awesome! Thank you.
 

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
1,024
Hello, I was wondering if anyone know how to upload a PLC program to the Beckhoff TwinCAT 3 from a file? i.e. without having the development pc...
Replies
0
Views
760
Hi anyone got any tips and tricks?? I'm at a stage wherei need to tidy up my hmi project and give all objects sensible names, I did start this...
Replies
0
Views
964
Hello, I have a System running a beckhoff IPC with twincat 2 software on it, Also i have no original source code. Is it possible with the...
Replies
1
Views
1,269
Hi all, I've inherited someone else's program and can't for the life of me figure out his use of the # symbol in one of his structured text...
Replies
5
Views
1,924
Back
Top Bottom